/**
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package chess;
/**
 *
 * @author Ray Walser
 */
public class MyForm extends javax.swing.JFrame {

    /**
     * Creates new form MyForm
     */
    public MyForm() {
        initComponents();
        loadIcons();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        outputMessageBoard = new javax.swing.JTextArea();
        moveButton = new javax.swing.JButton();
        undoButton = new javax.swing.JButton();
        iForfeit = new javax.swing.JButton();
        helpButton = new javax.swing.JButton();
        scoreButton = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        OneZero = new javax.swing.JButton();
        OneThree = new javax.swing.JButton();
        ThreeTwo = new javax.swing.JButton();
        OneFive = new javax.swing.JButton();
        FourFour = new javax.swing.JButton();
        SevenZero = new javax.swing.JButton();
        SixOne = new javax.swing.JButton();
        ThreeSix = new javax.swing.JButton();
        ThreeThree = new javax.swing.JButton();
        FourFive = new javax.swing.JButton();
        FourSeven = new javax.swing.JButton();
        ZeroSix = new javax.swing.JButton();
        ZeroTwo = new javax.swing.JButton();
        FourTwo = new javax.swing.JButton();
        ZeroFive = new javax.swing.JButton();
        TwoTwo = new javax.swing.JButton();
        ThreeOne = new javax.swing.JButton();
        FiveFive = new javax.swing.JButton();
        ThreeZero = new javax.swing.JButton();
        SevenSix = new javax.swing.JButton();
        FourThree = new javax.swing.JButton();
        FiveOne = new javax.swing.JButton();
        FourOne = new javax.swing.JButton();
        SixFive = new javax.swing.JButton();
        OneSix = new javax.swing.JButton();
        ZeroZero = new javax.swing.JButton();
        OneFour = new javax.swing.JButton();
        FiveThree = new javax.swing.JButton();
        FiveSix = new javax.swing.JButton();
        FiveZero = new javax.swing.JButton();
        TwoOne = new javax.swing.JButton();
        ThreeSeven = new javax.swing.JButton();
        ThreeFive = new javax.swing.JButton();
        OneSeven = new javax.swing.JButton();
        SevenFour = new javax.swing.JButton();
        TwoThree = new javax.swing.JButton();
        SixThree = new javax.swing.JButton();
        SixZero = new javax.swing.JButton();
        SevenOne = new javax.swing.JButton();
        TwoSix = new javax.swing.JButton();
        OneTwo = new javax.swing.JButton();
        FiveFour = new javax.swing.JButton();
        SevenSeven = new javax.swing.JButton();
        ZeroOne = new javax.swing.JButton();
        TwoSeven = new javax.swing.JButton();
        SevenThree = new javax.swing.JButton();
        SixSix = new javax.swing.JButton();
        FiveTwo = new javax.swing.JButton();
        ZeroThree = new javax.swing.JButton();
        FourZero = new javax.swing.JButton();
        SixTwo = new javax.swing.JButton();
        TwoFour = new javax.swing.JButton();
        FourSix = new javax.swing.JButton();
        FiveSeven = new javax.swing.JButton();
        SevenTwo = new javax.swing.JButton();
        ZeroFour = new javax.swing.JButton();
        OneOne = new javax.swing.JButton();
        SixFour = new javax.swing.JButton();
        TwoZero = new javax.swing.JButton();
        SevenFive = new javax.swing.JButton();
        TwoFive = new javax.swing.JButton();
        ZeroSeven = new javax.swing.JButton();
        ThreeFour = new javax.swing.JButton();
        SixSeven = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("CS 344 2013 - Chess Game");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setResizable(false);

        outputMessageBoard.setEditable(false);
        outputMessageBoard.setColumns(20);
        outputMessageBoard.setRows(5);
        outputMessageBoard.setFocusable(false);
        jScrollPane1.setViewportView(outputMessageBoard);

        moveButton.setBackground(new java.awt.Color(200, 200, 200));
        moveButton.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        moveButton.setText("Move");
        moveButton.setFocusable(false);
        moveButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        moveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                moveButtonActionPerformed(evt);
            }
        });

        undoButton.setBackground(new java.awt.Color(200, 200, 200));
        undoButton.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        undoButton.setText("Undo");
        undoButton.setFocusable(false);
        undoButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        undoButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                undoButtonActionPerformed(evt);
            }
        });

        iForfeit.setBackground(new java.awt.Color(200, 200, 200));
        iForfeit.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        iForfeit.setText("Resign");
        iForfeit.setToolTipText("");
        iForfeit.setFocusable(false);
        iForfeit.setMargin(new java.awt.Insets(0, 0, 0, 0));
        iForfeit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                iForfeitActionPerformed(evt);
            }
        });

        helpButton.setBackground(new java.awt.Color(200, 200, 200));
        helpButton.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        helpButton.setText("Help");
        helpButton.setFocusable(false);
        helpButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        helpButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                helpButtonActionPerformed(evt);
            }
        });

        scoreButton.setBackground(new java.awt.Color(200, 200, 200));
        scoreButton.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        scoreButton.setText("Score");
        scoreButton.setFocusable(false);
        scoreButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        scoreButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                scoreButtonActionPerformed(evt);
            }
        });

        jPanel1.setBackground(new java.awt.Color(51, 51, 51));
        jPanel1.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(153, 153, 153), new java.awt.Color(102, 102, 102), new java.awt.Color(0, 0, 0), new java.awt.Color(51, 51, 51)), javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 102), 25), javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, new java.awt.Color(51, 51, 51), new java.awt.Color(51, 51, 51), new java.awt.Color(0, 0, 0), new java.awt.Color(51, 51, 51)))));

        OneZero.setBorder(null);
        OneZero.setBorderPainted(false);
        OneZero.setDoubleBuffered(true);
        OneZero.setFocusable(false);
        OneZero.setMargin(new java.awt.Insets(5, 5, 5, 5));
        OneZero.setMaximumSize(new java.awt.Dimension(60, 50));
        OneZero.setMinimumSize(new java.awt.Dimension(60, 50));
        OneZero.setPreferredSize(new java.awt.Dimension(60, 50));
        OneZero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OneZeroActionPerformed(evt);
            }
        });

        OneThree.setBackground(new java.awt.Color(102, 102, 102));
        OneThree.setBorder(null);
        OneThree.setBorderPainted(false);
        OneThree.setDoubleBuffered(true);
        OneThree.setFocusable(false);
        OneThree.setMargin(new java.awt.Insets(5, 5, 5, 5));
        OneThree.setMaximumSize(new java.awt.Dimension(60, 50));
        OneThree.setMinimumSize(new java.awt.Dimension(60, 50));
        OneThree.setPreferredSize(new java.awt.Dimension(60, 50));
        OneThree.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OneThreeActionPerformed(evt);
            }
        });

        ThreeTwo.setBorder(null);
        ThreeTwo.setBorderPainted(false);
        ThreeTwo.setDoubleBuffered(true);
        ThreeTwo.setFocusable(false);
        ThreeTwo.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ThreeTwo.setMaximumSize(new java.awt.Dimension(60, 50));
        ThreeTwo.setMinimumSize(new java.awt.Dimension(60, 50));
        ThreeTwo.setPreferredSize(new java.awt.Dimension(60, 50));
        ThreeTwo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ThreeTwoActionPerformed(evt);
            }
        });

        OneFive.setBackground(new java.awt.Color(102, 102, 102));
        OneFive.setBorder(null);
        OneFive.setBorderPainted(false);
        OneFive.setDoubleBuffered(true);
        OneFive.setFocusable(false);
        OneFive.setMargin(new java.awt.Insets(5, 5, 5, 5));
        OneFive.setMaximumSize(new java.awt.Dimension(60, 50));
        OneFive.setMinimumSize(new java.awt.Dimension(60, 50));
        OneFive.setPreferredSize(new java.awt.Dimension(60, 50));
        OneFive.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OneFiveActionPerformed(evt);
            }
        });

        FourFour.setBackground(new java.awt.Color(102, 102, 102));
        FourFour.setBorder(null);
        FourFour.setBorderPainted(false);
        FourFour.setDoubleBuffered(true);
        FourFour.setFocusable(false);
        FourFour.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FourFour.setMaximumSize(new java.awt.Dimension(60, 50));
        FourFour.setMinimumSize(new java.awt.Dimension(60, 50));
        FourFour.setPreferredSize(new java.awt.Dimension(60, 50));
        FourFour.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FourFourActionPerformed(evt);
            }
        });

        SevenZero.setBorder(null);
        SevenZero.setBorderPainted(false);
        SevenZero.setDoubleBuffered(true);
        SevenZero.setFocusable(false);
        SevenZero.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SevenZero.setMaximumSize(new java.awt.Dimension(60, 50));
        SevenZero.setMinimumSize(new java.awt.Dimension(60, 50));
        SevenZero.setPreferredSize(new java.awt.Dimension(60, 50));
        SevenZero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SevenZeroActionPerformed(evt);
            }
        });

        SixOne.setBorder(null);
        SixOne.setBorderPainted(false);
        SixOne.setDoubleBuffered(true);
        SixOne.setFocusable(false);
        SixOne.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SixOne.setMaximumSize(new java.awt.Dimension(60, 50));
        SixOne.setMinimumSize(new java.awt.Dimension(60, 50));
        SixOne.setPreferredSize(new java.awt.Dimension(60, 50));
        SixOne.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SixOneActionPerformed(evt);
            }
        });

        ThreeSix.setBorder(null);
        ThreeSix.setBorderPainted(false);
        ThreeSix.setDoubleBuffered(true);
        ThreeSix.setFocusable(false);
        ThreeSix.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ThreeSix.setMaximumSize(new java.awt.Dimension(60, 50));
        ThreeSix.setMinimumSize(new java.awt.Dimension(60, 50));
        ThreeSix.setPreferredSize(new java.awt.Dimension(60, 50));
        ThreeSix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ThreeSixActionPerformed(evt);
            }
        });

        ThreeThree.setBackground(new java.awt.Color(102, 102, 102));
        ThreeThree.setBorder(null);
        ThreeThree.setBorderPainted(false);
        ThreeThree.setDoubleBuffered(true);
        ThreeThree.setFocusable(false);
        ThreeThree.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ThreeThree.setMaximumSize(new java.awt.Dimension(60, 50));
        ThreeThree.setMinimumSize(new java.awt.Dimension(60, 50));
        ThreeThree.setPreferredSize(new java.awt.Dimension(60, 50));
        ThreeThree.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ThreeThreeActionPerformed(evt);
            }
        });

        FourFive.setBorder(null);
        FourFive.setBorderPainted(false);
        FourFive.setDoubleBuffered(true);
        FourFive.setFocusable(false);
        FourFive.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FourFive.setMaximumSize(new java.awt.Dimension(60, 50));
        FourFive.setMinimumSize(new java.awt.Dimension(60, 50));
        FourFive.setPreferredSize(new java.awt.Dimension(60, 50));
        FourFive.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FourFiveActionPerformed(evt);
            }
        });

        FourSeven.setBorder(null);
        FourSeven.setBorderPainted(false);
        FourSeven.setDoubleBuffered(true);
        FourSeven.setFocusable(false);
        FourSeven.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FourSeven.setMaximumSize(new java.awt.Dimension(60, 50));
        FourSeven.setMinimumSize(new java.awt.Dimension(60, 50));
        FourSeven.setPreferredSize(new java.awt.Dimension(60, 50));
        FourSeven.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FourSevenActionPerformed(evt);
            }
        });

        ZeroSix.setBackground(new java.awt.Color(102, 102, 102));
        ZeroSix.setBorder(null);
        ZeroSix.setBorderPainted(false);
        ZeroSix.setDoubleBuffered(true);
        ZeroSix.setFocusable(false);
        ZeroSix.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ZeroSix.setMaximumSize(new java.awt.Dimension(60, 50));
        ZeroSix.setMinimumSize(new java.awt.Dimension(60, 50));
        ZeroSix.setPreferredSize(new java.awt.Dimension(60, 50));
        ZeroSix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ZeroSixActionPerformed(evt);
            }
        });

        ZeroTwo.setBackground(new java.awt.Color(102, 102, 102));
        ZeroTwo.setBorder(null);
        ZeroTwo.setBorderPainted(false);
        ZeroTwo.setDoubleBuffered(true);
        ZeroTwo.setFocusable(false);
        ZeroTwo.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ZeroTwo.setMaximumSize(new java.awt.Dimension(60, 50));
        ZeroTwo.setMinimumSize(new java.awt.Dimension(60, 50));
        ZeroTwo.setPreferredSize(new java.awt.Dimension(60, 50));
        ZeroTwo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ZeroTwoActionPerformed(evt);
            }
        });

        FourTwo.setBackground(new java.awt.Color(102, 102, 102));
        FourTwo.setBorder(null);
        FourTwo.setBorderPainted(false);
        FourTwo.setDoubleBuffered(true);
        FourTwo.setFocusable(false);
        FourTwo.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FourTwo.setMaximumSize(new java.awt.Dimension(60, 50));
        FourTwo.setMinimumSize(new java.awt.Dimension(60, 50));
        FourTwo.setPreferredSize(new java.awt.Dimension(60, 50));
        FourTwo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FourTwoActionPerformed(evt);
            }
        });

        ZeroFive.setBorder(null);
        ZeroFive.setBorderPainted(false);
        ZeroFive.setDoubleBuffered(true);
        ZeroFive.setFocusable(false);
        ZeroFive.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ZeroFive.setMaximumSize(new java.awt.Dimension(60, 50));
        ZeroFive.setMinimumSize(new java.awt.Dimension(60, 50));
        ZeroFive.setPreferredSize(new java.awt.Dimension(60, 50));
        ZeroFive.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ZeroFiveActionPerformed(evt);
            }
        });

        TwoTwo.setBackground(new java.awt.Color(102, 102, 102));
        TwoTwo.setBorder(null);
        TwoTwo.setBorderPainted(false);
        TwoTwo.setDoubleBuffered(true);
        TwoTwo.setFocusable(false);
        TwoTwo.setMargin(new java.awt.Insets(5, 5, 5, 5));
        TwoTwo.setMaximumSize(new java.awt.Dimension(60, 50));
        TwoTwo.setMinimumSize(new java.awt.Dimension(60, 50));
        TwoTwo.setPreferredSize(new java.awt.Dimension(60, 50));
        TwoTwo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TwoTwoActionPerformed(evt);
            }
        });

        ThreeOne.setBackground(new java.awt.Color(102, 102, 102));
        ThreeOne.setBorder(null);
        ThreeOne.setBorderPainted(false);
        ThreeOne.setDoubleBuffered(true);
        ThreeOne.setFocusable(false);
        ThreeOne.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ThreeOne.setMaximumSize(new java.awt.Dimension(60, 50));
        ThreeOne.setMinimumSize(new java.awt.Dimension(60, 50));
        ThreeOne.setPreferredSize(new java.awt.Dimension(60, 50));
        ThreeOne.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ThreeOneActionPerformed(evt);
            }
        });

        FiveFive.setBackground(new java.awt.Color(102, 102, 102));
        FiveFive.setBorder(null);
        FiveFive.setBorderPainted(false);
        FiveFive.setDoubleBuffered(true);
        FiveFive.setFocusable(false);
        FiveFive.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FiveFive.setMaximumSize(new java.awt.Dimension(60, 50));
        FiveFive.setMinimumSize(new java.awt.Dimension(60, 50));
        FiveFive.setPreferredSize(new java.awt.Dimension(60, 50));
        FiveFive.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FiveFiveActionPerformed(evt);
            }
        });

        ThreeZero.setBorder(null);
        ThreeZero.setBorderPainted(false);
        ThreeZero.setDoubleBuffered(true);
        ThreeZero.setFocusable(false);
        ThreeZero.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ThreeZero.setMaximumSize(new java.awt.Dimension(60, 50));
        ThreeZero.setMinimumSize(new java.awt.Dimension(60, 50));
        ThreeZero.setPreferredSize(new java.awt.Dimension(60, 50));
        ThreeZero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ThreeZeroActionPerformed(evt);
            }
        });

        SevenSix.setBorder(null);
        SevenSix.setBorderPainted(false);
        SevenSix.setDoubleBuffered(true);
        SevenSix.setFocusable(false);
        SevenSix.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SevenSix.setMaximumSize(new java.awt.Dimension(60, 50));
        SevenSix.setMinimumSize(new java.awt.Dimension(60, 50));
        SevenSix.setPreferredSize(new java.awt.Dimension(60, 50));
        SevenSix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SevenSixActionPerformed(evt);
            }
        });

        FourThree.setBorder(null);
        FourThree.setBorderPainted(false);
        FourThree.setDoubleBuffered(true);
        FourThree.setFocusable(false);
        FourThree.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FourThree.setMaximumSize(new java.awt.Dimension(60, 50));
        FourThree.setMinimumSize(new java.awt.Dimension(60, 50));
        FourThree.setPreferredSize(new java.awt.Dimension(60, 50));
        FourThree.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FourThreeActionPerformed(evt);
            }
        });

        FiveOne.setBackground(new java.awt.Color(102, 102, 102));
        FiveOne.setBorder(null);
        FiveOne.setBorderPainted(false);
        FiveOne.setDoubleBuffered(true);
        FiveOne.setFocusable(false);
        FiveOne.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FiveOne.setMaximumSize(new java.awt.Dimension(60, 50));
        FiveOne.setMinimumSize(new java.awt.Dimension(60, 50));
        FiveOne.setPreferredSize(new java.awt.Dimension(60, 50));
        FiveOne.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FiveOneActionPerformed(evt);
            }
        });

        FourOne.setBorder(null);
        FourOne.setBorderPainted(false);
        FourOne.setDoubleBuffered(true);
        FourOne.setFocusable(false);
        FourOne.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FourOne.setMaximumSize(new java.awt.Dimension(60, 50));
        FourOne.setMinimumSize(new java.awt.Dimension(60, 50));
        FourOne.setPreferredSize(new java.awt.Dimension(60, 50));
        FourOne.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FourOneActionPerformed(evt);
            }
        });

        SixFive.setBorder(null);
        SixFive.setBorderPainted(false);
        SixFive.setDoubleBuffered(true);
        SixFive.setFocusable(false);
        SixFive.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SixFive.setMaximumSize(new java.awt.Dimension(60, 50));
        SixFive.setMinimumSize(new java.awt.Dimension(60, 50));
        SixFive.setPreferredSize(new java.awt.Dimension(60, 50));
        SixFive.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SixFiveActionPerformed(evt);
            }
        });

        OneSix.setBorder(null);
        OneSix.setBorderPainted(false);
        OneSix.setDoubleBuffered(true);
        OneSix.setFocusable(false);
        OneSix.setMargin(new java.awt.Insets(5, 5, 5, 5));
        OneSix.setMaximumSize(new java.awt.Dimension(60, 50));
        OneSix.setMinimumSize(new java.awt.Dimension(60, 50));
        OneSix.setPreferredSize(new java.awt.Dimension(60, 50));
        OneSix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OneSixActionPerformed(evt);
            }
        });

        ZeroZero.setBackground(new java.awt.Color(102, 102, 102));
        ZeroZero.setBorder(null);
        ZeroZero.setBorderPainted(false);
        ZeroZero.setDoubleBuffered(true);
        ZeroZero.setFocusable(false);
        ZeroZero.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ZeroZero.setMaximumSize(new java.awt.Dimension(60, 50));
        ZeroZero.setMinimumSize(new java.awt.Dimension(60, 50));
        ZeroZero.setPreferredSize(new java.awt.Dimension(60, 50));
        ZeroZero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ZeroZeroActionPerformed(evt);
            }
        });

        OneFour.setBorder(null);
        OneFour.setBorderPainted(false);
        OneFour.setDoubleBuffered(true);
        OneFour.setFocusable(false);
        OneFour.setMargin(new java.awt.Insets(5, 5, 5, 5));
        OneFour.setMaximumSize(new java.awt.Dimension(60, 50));
        OneFour.setMinimumSize(new java.awt.Dimension(60, 50));
        OneFour.setPreferredSize(new java.awt.Dimension(60, 50));
        OneFour.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OneFourActionPerformed(evt);
            }
        });

        FiveThree.setBackground(new java.awt.Color(102, 102, 102));
        FiveThree.setBorder(null);
        FiveThree.setBorderPainted(false);
        FiveThree.setDoubleBuffered(true);
        FiveThree.setFocusable(false);
        FiveThree.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FiveThree.setMaximumSize(new java.awt.Dimension(60, 50));
        FiveThree.setMinimumSize(new java.awt.Dimension(60, 50));
        FiveThree.setPreferredSize(new java.awt.Dimension(60, 50));
        FiveThree.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FiveThreeActionPerformed(evt);
            }
        });

        FiveSix.setBorder(null);
        FiveSix.setBorderPainted(false);
        FiveSix.setDoubleBuffered(true);
        FiveSix.setFocusable(false);
        FiveSix.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FiveSix.setMaximumSize(new java.awt.Dimension(60, 50));
        FiveSix.setMinimumSize(new java.awt.Dimension(60, 50));
        FiveSix.setPreferredSize(new java.awt.Dimension(60, 50));
        FiveSix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FiveSixActionPerformed(evt);
            }
        });

        FiveZero.setBorder(null);
        FiveZero.setBorderPainted(false);
        FiveZero.setDoubleBuffered(true);
        FiveZero.setFocusable(false);
        FiveZero.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FiveZero.setMaximumSize(new java.awt.Dimension(60, 50));
        FiveZero.setMinimumSize(new java.awt.Dimension(60, 50));
        FiveZero.setPreferredSize(new java.awt.Dimension(60, 50));
        FiveZero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FiveZeroActionPerformed(evt);
            }
        });

        TwoOne.setBorder(null);
        TwoOne.setBorderPainted(false);
        TwoOne.setDoubleBuffered(true);
        TwoOne.setFocusable(false);
        TwoOne.setMargin(new java.awt.Insets(5, 5, 5, 5));
        TwoOne.setMaximumSize(new java.awt.Dimension(60, 50));
        TwoOne.setMinimumSize(new java.awt.Dimension(60, 50));
        TwoOne.setPreferredSize(new java.awt.Dimension(60, 50));
        TwoOne.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TwoOneActionPerformed(evt);
            }
        });

        ThreeSeven.setBackground(new java.awt.Color(102, 102, 102));
        ThreeSeven.setBorder(null);
        ThreeSeven.setBorderPainted(false);
        ThreeSeven.setDoubleBuffered(true);
        ThreeSeven.setFocusable(false);
        ThreeSeven.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ThreeSeven.setMaximumSize(new java.awt.Dimension(60, 50));
        ThreeSeven.setMinimumSize(new java.awt.Dimension(60, 50));
        ThreeSeven.setPreferredSize(new java.awt.Dimension(60, 50));
        ThreeSeven.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ThreeSevenActionPerformed(evt);
            }
        });

        ThreeFive.setBackground(new java.awt.Color(102, 102, 102));
        ThreeFive.setBorder(null);
        ThreeFive.setBorderPainted(false);
        ThreeFive.setDoubleBuffered(true);
        ThreeFive.setFocusable(false);
        ThreeFive.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ThreeFive.setMaximumSize(new java.awt.Dimension(60, 50));
        ThreeFive.setMinimumSize(new java.awt.Dimension(60, 50));
        ThreeFive.setPreferredSize(new java.awt.Dimension(60, 50));
        ThreeFive.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ThreeFiveActionPerformed(evt);
            }
        });

        OneSeven.setBackground(new java.awt.Color(102, 102, 102));
        OneSeven.setBorder(null);
        OneSeven.setBorderPainted(false);
        OneSeven.setDoubleBuffered(true);
        OneSeven.setFocusable(false);
        OneSeven.setMargin(new java.awt.Insets(5, 5, 5, 5));
        OneSeven.setMaximumSize(new java.awt.Dimension(60, 50));
        OneSeven.setMinimumSize(new java.awt.Dimension(60, 50));
        OneSeven.setPreferredSize(new java.awt.Dimension(60, 50));
        OneSeven.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OneSevenActionPerformed(evt);
            }
        });

        SevenFour.setBorder(null);
        SevenFour.setBorderPainted(false);
        SevenFour.setDoubleBuffered(true);
        SevenFour.setFocusable(false);
        SevenFour.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SevenFour.setMaximumSize(new java.awt.Dimension(60, 50));
        SevenFour.setMinimumSize(new java.awt.Dimension(60, 50));
        SevenFour.setPreferredSize(new java.awt.Dimension(60, 50));
        SevenFour.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SevenFourActionPerformed(evt);
            }
        });

        TwoThree.setBorder(null);
        TwoThree.setBorderPainted(false);
        TwoThree.setDoubleBuffered(true);
        TwoThree.setFocusable(false);
        TwoThree.setMargin(new java.awt.Insets(5, 5, 5, 5));
        TwoThree.setMaximumSize(new java.awt.Dimension(60, 50));
        TwoThree.setMinimumSize(new java.awt.Dimension(60, 50));
        TwoThree.setPreferredSize(new java.awt.Dimension(60, 50));
        TwoThree.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TwoThreeActionPerformed(evt);
            }
        });

        SixThree.setBorder(null);
        SixThree.setBorderPainted(false);
        SixThree.setDoubleBuffered(true);
        SixThree.setFocusable(false);
        SixThree.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SixThree.setMaximumSize(new java.awt.Dimension(60, 50));
        SixThree.setMinimumSize(new java.awt.Dimension(60, 50));
        SixThree.setPreferredSize(new java.awt.Dimension(60, 50));
        SixThree.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SixThreeActionPerformed(evt);
            }
        });

        SixZero.setBackground(new java.awt.Color(102, 102, 102));
        SixZero.setBorder(null);
        SixZero.setBorderPainted(false);
        SixZero.setDoubleBuffered(true);
        SixZero.setFocusable(false);
        SixZero.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SixZero.setMaximumSize(new java.awt.Dimension(60, 50));
        SixZero.setMinimumSize(new java.awt.Dimension(60, 50));
        SixZero.setPreferredSize(new java.awt.Dimension(60, 50));
        SixZero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SixZeroActionPerformed(evt);
            }
        });

        SevenOne.setBackground(new java.awt.Color(102, 102, 102));
        SevenOne.setBorder(null);
        SevenOne.setBorderPainted(false);
        SevenOne.setDoubleBuffered(true);
        SevenOne.setFocusable(false);
        SevenOne.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SevenOne.setMaximumSize(new java.awt.Dimension(60, 50));
        SevenOne.setMinimumSize(new java.awt.Dimension(60, 50));
        SevenOne.setPreferredSize(new java.awt.Dimension(60, 50));
        SevenOne.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SevenOneActionPerformed(evt);
            }
        });

        TwoSix.setBackground(new java.awt.Color(102, 102, 102));
        TwoSix.setBorder(null);
        TwoSix.setBorderPainted(false);
        TwoSix.setDoubleBuffered(true);
        TwoSix.setFocusable(false);
        TwoSix.setMargin(new java.awt.Insets(5, 5, 5, 5));
        TwoSix.setMaximumSize(new java.awt.Dimension(60, 50));
        TwoSix.setMinimumSize(new java.awt.Dimension(60, 50));
        TwoSix.setPreferredSize(new java.awt.Dimension(60, 50));
        TwoSix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TwoSixActionPerformed(evt);
            }
        });

        OneTwo.setBorder(null);
        OneTwo.setBorderPainted(false);
        OneTwo.setDoubleBuffered(true);
        OneTwo.setFocusable(false);
        OneTwo.setMargin(new java.awt.Insets(5, 5, 5, 5));
        OneTwo.setMaximumSize(new java.awt.Dimension(60, 50));
        OneTwo.setMinimumSize(new java.awt.Dimension(60, 50));
        OneTwo.setPreferredSize(new java.awt.Dimension(60, 50));
        OneTwo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OneTwoActionPerformed(evt);
            }
        });

        FiveFour.setBorder(null);
        FiveFour.setBorderPainted(false);
        FiveFour.setDoubleBuffered(true);
        FiveFour.setFocusable(false);
        FiveFour.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FiveFour.setMaximumSize(new java.awt.Dimension(60, 50));
        FiveFour.setMinimumSize(new java.awt.Dimension(60, 50));
        FiveFour.setPreferredSize(new java.awt.Dimension(60, 50));
        FiveFour.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FiveFourActionPerformed(evt);
            }
        });

        SevenSeven.setBackground(new java.awt.Color(102, 102, 102));
        SevenSeven.setBorder(null);
        SevenSeven.setBorderPainted(false);
        SevenSeven.setDoubleBuffered(true);
        SevenSeven.setFocusable(false);
        SevenSeven.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SevenSeven.setMaximumSize(new java.awt.Dimension(60, 50));
        SevenSeven.setMinimumSize(new java.awt.Dimension(60, 50));
        SevenSeven.setPreferredSize(new java.awt.Dimension(60, 50));
        SevenSeven.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SevenSevenActionPerformed(evt);
            }
        });

        ZeroOne.setBorder(null);
        ZeroOne.setBorderPainted(false);
        ZeroOne.setDoubleBuffered(true);
        ZeroOne.setFocusable(false);
        ZeroOne.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ZeroOne.setMaximumSize(new java.awt.Dimension(60, 50));
        ZeroOne.setMinimumSize(new java.awt.Dimension(60, 50));
        ZeroOne.setPreferredSize(new java.awt.Dimension(60, 50));
        ZeroOne.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ZeroOneActionPerformed(evt);
            }
        });

        TwoSeven.setBorder(null);
        TwoSeven.setBorderPainted(false);
        TwoSeven.setDoubleBuffered(true);
        TwoSeven.setFocusable(false);
        TwoSeven.setMargin(new java.awt.Insets(5, 5, 5, 5));
        TwoSeven.setMaximumSize(new java.awt.Dimension(60, 50));
        TwoSeven.setMinimumSize(new java.awt.Dimension(60, 50));
        TwoSeven.setPreferredSize(new java.awt.Dimension(60, 50));
        TwoSeven.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TwoSevenActionPerformed(evt);
            }
        });

        SevenThree.setBackground(new java.awt.Color(102, 102, 102));
        SevenThree.setBorder(null);
        SevenThree.setBorderPainted(false);
        SevenThree.setDoubleBuffered(true);
        SevenThree.setFocusable(false);
        SevenThree.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SevenThree.setMaximumSize(new java.awt.Dimension(60, 50));
        SevenThree.setMinimumSize(new java.awt.Dimension(60, 50));
        SevenThree.setPreferredSize(new java.awt.Dimension(60, 50));
        SevenThree.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SevenThreeActionPerformed(evt);
            }
        });

        SixSix.setBackground(new java.awt.Color(102, 102, 102));
        SixSix.setBorder(null);
        SixSix.setBorderPainted(false);
        SixSix.setDoubleBuffered(true);
        SixSix.setFocusable(false);
        SixSix.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SixSix.setMaximumSize(new java.awt.Dimension(60, 50));
        SixSix.setMinimumSize(new java.awt.Dimension(60, 50));
        SixSix.setPreferredSize(new java.awt.Dimension(60, 50));
        SixSix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SixSixActionPerformed(evt);
            }
        });

        FiveTwo.setBorder(null);
        FiveTwo.setBorderPainted(false);
        FiveTwo.setDoubleBuffered(true);
        FiveTwo.setFocusable(false);
        FiveTwo.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FiveTwo.setMaximumSize(new java.awt.Dimension(60, 50));
        FiveTwo.setMinimumSize(new java.awt.Dimension(60, 50));
        FiveTwo.setPreferredSize(new java.awt.Dimension(60, 50));
        FiveTwo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FiveTwoActionPerformed(evt);
            }
        });

        ZeroThree.setBorder(null);
        ZeroThree.setBorderPainted(false);
        ZeroThree.setDoubleBuffered(true);
        ZeroThree.setFocusable(false);
        ZeroThree.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ZeroThree.setMaximumSize(new java.awt.Dimension(60, 50));
        ZeroThree.setMinimumSize(new java.awt.Dimension(60, 50));
        ZeroThree.setPreferredSize(new java.awt.Dimension(60, 50));
        ZeroThree.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ZeroThreeActionPerformed(evt);
            }
        });

        FourZero.setBackground(new java.awt.Color(102, 102, 102));
        FourZero.setBorder(null);
        FourZero.setBorderPainted(false);
        FourZero.setDoubleBuffered(true);
        FourZero.setFocusable(false);
        FourZero.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FourZero.setMaximumSize(new java.awt.Dimension(60, 50));
        FourZero.setMinimumSize(new java.awt.Dimension(60, 50));
        FourZero.setPreferredSize(new java.awt.Dimension(60, 50));
        FourZero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FourZeroActionPerformed(evt);
            }
        });

        SixTwo.setBackground(new java.awt.Color(102, 102, 102));
        SixTwo.setBorder(null);
        SixTwo.setBorderPainted(false);
        SixTwo.setDoubleBuffered(true);
        SixTwo.setFocusable(false);
        SixTwo.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SixTwo.setMaximumSize(new java.awt.Dimension(60, 50));
        SixTwo.setMinimumSize(new java.awt.Dimension(60, 50));
        SixTwo.setPreferredSize(new java.awt.Dimension(60, 50));
        SixTwo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SixTwoActionPerformed(evt);
            }
        });

        TwoFour.setBackground(new java.awt.Color(102, 102, 102));
        TwoFour.setBorder(null);
        TwoFour.setBorderPainted(false);
        TwoFour.setDoubleBuffered(true);
        TwoFour.setFocusable(false);
        TwoFour.setMargin(new java.awt.Insets(5, 5, 5, 5));
        TwoFour.setMaximumSize(new java.awt.Dimension(60, 50));
        TwoFour.setMinimumSize(new java.awt.Dimension(60, 50));
        TwoFour.setPreferredSize(new java.awt.Dimension(60, 50));
        TwoFour.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TwoFourActionPerformed(evt);
            }
        });

        FourSix.setBackground(new java.awt.Color(102, 102, 102));
        FourSix.setBorder(null);
        FourSix.setBorderPainted(false);
        FourSix.setDoubleBuffered(true);
        FourSix.setFocusable(false);
        FourSix.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FourSix.setMaximumSize(new java.awt.Dimension(60, 50));
        FourSix.setMinimumSize(new java.awt.Dimension(60, 50));
        FourSix.setPreferredSize(new java.awt.Dimension(60, 50));
        FourSix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FourSixActionPerformed(evt);
            }
        });

        FiveSeven.setBackground(new java.awt.Color(102, 102, 102));
        FiveSeven.setBorder(null);
        FiveSeven.setBorderPainted(false);
        FiveSeven.setDoubleBuffered(true);
        FiveSeven.setFocusable(false);
        FiveSeven.setMargin(new java.awt.Insets(5, 5, 5, 5));
        FiveSeven.setMaximumSize(new java.awt.Dimension(60, 50));
        FiveSeven.setMinimumSize(new java.awt.Dimension(60, 50));
        FiveSeven.setPreferredSize(new java.awt.Dimension(60, 50));
        FiveSeven.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FiveSevenActionPerformed(evt);
            }
        });

        SevenTwo.setBorder(null);
        SevenTwo.setBorderPainted(false);
        SevenTwo.setDoubleBuffered(true);
        SevenTwo.setFocusable(false);
        SevenTwo.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SevenTwo.setMaximumSize(new java.awt.Dimension(60, 50));
        SevenTwo.setMinimumSize(new java.awt.Dimension(60, 50));
        SevenTwo.setPreferredSize(new java.awt.Dimension(60, 50));
        SevenTwo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SevenTwoActionPerformed(evt);
            }
        });

        ZeroFour.setBackground(new java.awt.Color(102, 102, 102));
        ZeroFour.setBorder(null);
        ZeroFour.setBorderPainted(false);
        ZeroFour.setDoubleBuffered(true);
        ZeroFour.setFocusable(false);
        ZeroFour.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ZeroFour.setMaximumSize(new java.awt.Dimension(60, 50));
        ZeroFour.setMinimumSize(new java.awt.Dimension(60, 50));
        ZeroFour.setPreferredSize(new java.awt.Dimension(60, 50));
        ZeroFour.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ZeroFourActionPerformed(evt);
            }
        });

        OneOne.setBackground(new java.awt.Color(102, 102, 102));
        OneOne.setBorder(null);
        OneOne.setBorderPainted(false);
        OneOne.setDoubleBuffered(true);
        OneOne.setFocusable(false);
        OneOne.setMargin(new java.awt.Insets(5, 5, 5, 5));
        OneOne.setMaximumSize(new java.awt.Dimension(60, 50));
        OneOne.setMinimumSize(new java.awt.Dimension(60, 50));
        OneOne.setPreferredSize(new java.awt.Dimension(60, 50));
        OneOne.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OneOneActionPerformed(evt);
            }
        });

        SixFour.setBackground(new java.awt.Color(102, 102, 102));
        SixFour.setBorder(null);
        SixFour.setBorderPainted(false);
        SixFour.setDoubleBuffered(true);
        SixFour.setFocusable(false);
        SixFour.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SixFour.setMaximumSize(new java.awt.Dimension(60, 50));
        SixFour.setMinimumSize(new java.awt.Dimension(60, 50));
        SixFour.setPreferredSize(new java.awt.Dimension(60, 50));
        SixFour.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SixFourActionPerformed(evt);
            }
        });

        TwoZero.setBackground(new java.awt.Color(102, 102, 102));
        TwoZero.setBorder(null);
        TwoZero.setBorderPainted(false);
        TwoZero.setDoubleBuffered(true);
        TwoZero.setFocusable(false);
        TwoZero.setMargin(new java.awt.Insets(5, 5, 5, 5));
        TwoZero.setMaximumSize(new java.awt.Dimension(60, 50));
        TwoZero.setMinimumSize(new java.awt.Dimension(60, 50));
        TwoZero.setPreferredSize(new java.awt.Dimension(60, 50));
        TwoZero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TwoZeroActionPerformed(evt);
            }
        });

        SevenFive.setBackground(new java.awt.Color(102, 102, 102));
        SevenFive.setBorder(null);
        SevenFive.setBorderPainted(false);
        SevenFive.setDoubleBuffered(true);
        SevenFive.setFocusable(false);
        SevenFive.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SevenFive.setMaximumSize(new java.awt.Dimension(60, 50));
        SevenFive.setMinimumSize(new java.awt.Dimension(60, 50));
        SevenFive.setPreferredSize(new java.awt.Dimension(60, 50));
        SevenFive.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SevenFiveActionPerformed(evt);
            }
        });

        TwoFive.setBorder(null);
        TwoFive.setBorderPainted(false);
        TwoFive.setDoubleBuffered(true);
        TwoFive.setFocusable(false);
        TwoFive.setMargin(new java.awt.Insets(5, 5, 5, 5));
        TwoFive.setMaximumSize(new java.awt.Dimension(60, 50));
        TwoFive.setMinimumSize(new java.awt.Dimension(60, 50));
        TwoFive.setPreferredSize(new java.awt.Dimension(60, 50));
        TwoFive.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TwoFiveActionPerformed(evt);
            }
        });

        ZeroSeven.setBorder(null);
        ZeroSeven.setBorderPainted(false);
        ZeroSeven.setDoubleBuffered(true);
        ZeroSeven.setFocusable(false);
        ZeroSeven.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ZeroSeven.setMaximumSize(new java.awt.Dimension(60, 50));
        ZeroSeven.setMinimumSize(new java.awt.Dimension(60, 50));
        ZeroSeven.setPreferredSize(new java.awt.Dimension(60, 50));
        ZeroSeven.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ZeroSevenActionPerformed(evt);
            }
        });

        ThreeFour.setBorder(null);
        ThreeFour.setBorderPainted(false);
        ThreeFour.setDoubleBuffered(true);
        ThreeFour.setFocusable(false);
        ThreeFour.setMargin(new java.awt.Insets(5, 5, 5, 5));
        ThreeFour.setMaximumSize(new java.awt.Dimension(60, 50));
        ThreeFour.setMinimumSize(new java.awt.Dimension(60, 50));
        ThreeFour.setPreferredSize(new java.awt.Dimension(60, 50));
        ThreeFour.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ThreeFourActionPerformed(evt);
            }
        });

        SixSeven.setBorder(null);
        SixSeven.setBorderPainted(false);
        SixSeven.setDoubleBuffered(true);
        SixSeven.setFocusable(false);
        SixSeven.setMargin(new java.awt.Insets(5, 5, 5, 5));
        SixSeven.setMaximumSize(new java.awt.Dimension(60, 50));
        SixSeven.setMinimumSize(new java.awt.Dimension(60, 50));
        SixSeven.setPreferredSize(new java.awt.Dimension(60, 50));
        SixSeven.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SixSevenActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(ZeroThree, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ZeroTwo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ZeroZero, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ZeroSeven, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ZeroOne, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ZeroFive, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ZeroSix, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ZeroFour, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(OneThree, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneTwo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneZero, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneSeven, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneOne, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneSix, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneFour, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneFive, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(TwoThree, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoTwo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoZero, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoSeven, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoOne, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoSix, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoFour, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoFive, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(ThreeThree, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeFour, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeSeven, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeTwo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeZero, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeOne, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeSix, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeFive, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(FourThree, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourFour, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourTwo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourZero, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourSeven, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourOne, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourSix, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourFive, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(FiveFour, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveSeven, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveTwo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveZero, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveThree, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveSix, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveOne, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveFive, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(SixFour, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixSeven, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixTwo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixThree, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixZero, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixSix, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixOne, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixFive, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(SevenFour, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenThree, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenZero, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenSix, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenOne, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenTwo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenSeven, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenFive, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ZeroSeven, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneSeven, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoSeven, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeSeven, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourSeven, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveSeven, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixSeven, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenSeven, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ZeroSix, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneSix, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoSix, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeSix, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourSix, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveSix, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixSix, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenSix, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ZeroFive, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneFive, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoFive, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeFive, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourFive, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveFive, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixFive, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenFive, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ZeroFour, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneFour, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoFour, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeFour, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourFour, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveFour, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixFour, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenFour, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ZeroThree, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneThree, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoThree, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeThree, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourThree, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveThree, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixThree, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenThree, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ZeroTwo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneTwo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoTwo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeTwo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourTwo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveTwo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixTwo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenTwo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ZeroOne, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneOne, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoOne, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeOne, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourOne, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveOne, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixOne, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenOne, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ZeroZero, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OneZero, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TwoZero, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ThreeZero, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FourZero, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SixZero, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SevenZero, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FiveZero, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, 0))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(moveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(helpButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(scoreButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(undoButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(iForfeit, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(undoButton, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(iForfeit, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(moveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(helpButton, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(scoreButton, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(10, 10, 10)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents














// These methods just print out the coorisponding x and y values to a text field.
// Each button has a x cooridnate and a y cooridnate. (0,0) is starting with the
// lower left hand corner of the board. Like a grid.
    
    
    
    
    
    
// <editor-fold defaultstate="collapsed" desc="Buttons">   
    private void ZeroZeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ZeroZeroActionPerformed
        identifyState(0, 0);       
    }//GEN-LAST:event_ZeroZeroActionPerformed

    private void OneZeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OneZeroActionPerformed
        identifyState(1, 0);       
    }//GEN-LAST:event_OneZeroActionPerformed

    private void TwoZeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TwoZeroActionPerformed
        identifyState(2, 0);       
    }//GEN-LAST:event_TwoZeroActionPerformed

    private void ThreeZeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ThreeZeroActionPerformed
        identifyState(3, 0);       
    }//GEN-LAST:event_ThreeZeroActionPerformed

    private void FourZeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FourZeroActionPerformed
        identifyState(4, 0);       
    }//GEN-LAST:event_FourZeroActionPerformed

    private void FiveZeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FiveZeroActionPerformed
        identifyState(5, 0);       
    }//GEN-LAST:event_FiveZeroActionPerformed

    private void SixZeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SixZeroActionPerformed
        identifyState(6, 0);       
    }//GEN-LAST:event_SixZeroActionPerformed

    private void SevenZeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SevenZeroActionPerformed
        identifyState(7, 0);       
    }//GEN-LAST:event_SevenZeroActionPerformed

    private void SevenOneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SevenOneActionPerformed
        identifyState(7, 1);       
    }//GEN-LAST:event_SevenOneActionPerformed

    private void FiveOneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FiveOneActionPerformed
        identifyState(5, 1);       
    }//GEN-LAST:event_FiveOneActionPerformed

    private void SixOneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SixOneActionPerformed
        identifyState(6, 1);       
    }//GEN-LAST:event_SixOneActionPerformed

    private void ThreeOneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ThreeOneActionPerformed
        identifyState(3, 1);       
    }//GEN-LAST:event_ThreeOneActionPerformed

    private void FourOneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FourOneActionPerformed
        identifyState(4, 1);       
    }//GEN-LAST:event_FourOneActionPerformed

    private void TwoOneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TwoOneActionPerformed
        identifyState(2,1);       
    }//GEN-LAST:event_TwoOneActionPerformed

    private void OneOneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OneOneActionPerformed
        identifyState(1, 1);       
    }//GEN-LAST:event_OneOneActionPerformed

    private void ZeroOneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ZeroOneActionPerformed
        identifyState(0, 1);       
    }//GEN-LAST:event_ZeroOneActionPerformed

    private void SevenTwoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SevenTwoActionPerformed
        identifyState(7, 2);       
    }//GEN-LAST:event_SevenTwoActionPerformed

    private void FiveTwoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FiveTwoActionPerformed
        identifyState(5, 2);       
    }//GEN-LAST:event_FiveTwoActionPerformed

    private void SixTwoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SixTwoActionPerformed
        identifyState(6, 2);       
    }//GEN-LAST:event_SixTwoActionPerformed

    private void ThreeTwoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ThreeTwoActionPerformed
        identifyState(3, 2);       
    }//GEN-LAST:event_ThreeTwoActionPerformed

    private void FourTwoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FourTwoActionPerformed
        identifyState(4, 2);       
    }//GEN-LAST:event_FourTwoActionPerformed

    private void TwoTwoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TwoTwoActionPerformed
        identifyState(2, 2);       
    }//GEN-LAST:event_TwoTwoActionPerformed

    private void OneTwoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OneTwoActionPerformed
        identifyState(1,2);       
    }//GEN-LAST:event_OneTwoActionPerformed

    private void ZeroTwoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ZeroTwoActionPerformed
        identifyState(0, 2);       
    }//GEN-LAST:event_ZeroTwoActionPerformed

    private void SevenThreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SevenThreeActionPerformed
        identifyState(7, 3);       
    }//GEN-LAST:event_SevenThreeActionPerformed

    private void FiveThreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FiveThreeActionPerformed
        identifyState(5, 3);       
    }//GEN-LAST:event_FiveThreeActionPerformed

    private void SixThreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SixThreeActionPerformed
        identifyState(6, 3);       
    }//GEN-LAST:event_SixThreeActionPerformed

    private void ThreeThreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ThreeThreeActionPerformed
        identifyState(3, 3);       
    }//GEN-LAST:event_ThreeThreeActionPerformed

    private void FourThreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FourThreeActionPerformed
        identifyState(4, 3);       
    }//GEN-LAST:event_FourThreeActionPerformed

    private void TwoThreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TwoThreeActionPerformed
        identifyState(2, 3);       
    }//GEN-LAST:event_TwoThreeActionPerformed

    private void OneThreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OneThreeActionPerformed
        identifyState(1, 3);       
    }//GEN-LAST:event_OneThreeActionPerformed

    private void ZeroThreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ZeroThreeActionPerformed
        identifyState(0, 3);       
    }//GEN-LAST:event_ZeroThreeActionPerformed

    private void SevenFourActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SevenFourActionPerformed
        identifyState(7, 4);       
    }//GEN-LAST:event_SevenFourActionPerformed

    private void FiveFourActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FiveFourActionPerformed
        identifyState(5,4);       
    }//GEN-LAST:event_FiveFourActionPerformed

    private void SixFourActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SixFourActionPerformed
        identifyState(6, 4);       
    }//GEN-LAST:event_SixFourActionPerformed

    private void ThreeFourActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ThreeFourActionPerformed
        identifyState(3, 4);       
    }//GEN-LAST:event_ThreeFourActionPerformed

    private void FourFourActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FourFourActionPerformed
        identifyState(4, 4);       
    }//GEN-LAST:event_FourFourActionPerformed

    private void TwoFourActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TwoFourActionPerformed
        identifyState(2, 4);       
    }//GEN-LAST:event_TwoFourActionPerformed

    private void OneFourActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OneFourActionPerformed
        identifyState(1, 4);       
    }//GEN-LAST:event_OneFourActionPerformed

    private void ZeroFourActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ZeroFourActionPerformed
        identifyState(0, 4);       
    }//GEN-LAST:event_ZeroFourActionPerformed

    private void SevenFiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SevenFiveActionPerformed
        identifyState(7, 5);       
    }//GEN-LAST:event_SevenFiveActionPerformed

    private void FiveFiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FiveFiveActionPerformed
        identifyState(5, 5);       
    }//GEN-LAST:event_FiveFiveActionPerformed

    private void SixFiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SixFiveActionPerformed
        identifyState(6, 5);       
    }//GEN-LAST:event_SixFiveActionPerformed

    private void ThreeFiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ThreeFiveActionPerformed
        identifyState(3, 5);       
    }//GEN-LAST:event_ThreeFiveActionPerformed

    private void FourFiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FourFiveActionPerformed
        identifyState(4, 5);       
    }//GEN-LAST:event_FourFiveActionPerformed

    private void TwoFiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TwoFiveActionPerformed
        identifyState(2, 5);       
    }//GEN-LAST:event_TwoFiveActionPerformed

    private void OneFiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OneFiveActionPerformed
        identifyState(1, 5);       
    }//GEN-LAST:event_OneFiveActionPerformed

    private void ZeroFiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ZeroFiveActionPerformed
        identifyState(0, 5);       
    }//GEN-LAST:event_ZeroFiveActionPerformed

    private void SevenSixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SevenSixActionPerformed
        identifyState(7, 6);       
    }//GEN-LAST:event_SevenSixActionPerformed

    private void FiveSixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FiveSixActionPerformed
        identifyState(5, 6);       
    }//GEN-LAST:event_FiveSixActionPerformed

    private void SixSixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SixSixActionPerformed
        identifyState(6, 6);       
    }//GEN-LAST:event_SixSixActionPerformed

    private void ThreeSixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ThreeSixActionPerformed
        identifyState(3, 6);       
    }//GEN-LAST:event_ThreeSixActionPerformed

    private void FourSixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FourSixActionPerformed
        identifyState(4, 6);       
    }//GEN-LAST:event_FourSixActionPerformed

    private void TwoSixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TwoSixActionPerformed
        identifyState(2, 5);       
    }//GEN-LAST:event_TwoSixActionPerformed

    private void OneSixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OneSixActionPerformed
        identifyState(1, 6);       
    }//GEN-LAST:event_OneSixActionPerformed

    private void ZeroSixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ZeroSixActionPerformed
        identifyState(0, 6);       
    }//GEN-LAST:event_ZeroSixActionPerformed

    private void SevenSevenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SevenSevenActionPerformed
        identifyState(7, 7);       
    }//GEN-LAST:event_SevenSevenActionPerformed

    private void FiveSevenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FiveSevenActionPerformed
        identifyState(5, 7);       
    }//GEN-LAST:event_FiveSevenActionPerformed

    private void SixSevenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SixSevenActionPerformed
        identifyState(6, 7);       
    }//GEN-LAST:event_SixSevenActionPerformed

    private void ThreeSevenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ThreeSevenActionPerformed
        identifyState(3, 7);       
    }//GEN-LAST:event_ThreeSevenActionPerformed

    private void FourSevenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FourSevenActionPerformed
        identifyState(4, 7);       
    }//GEN-LAST:event_FourSevenActionPerformed

    private void TwoSevenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TwoSevenActionPerformed
        identifyState(2, 7);       
    }//GEN-LAST:event_TwoSevenActionPerformed

    private void OneSevenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OneSevenActionPerformed
        identifyState(1, 7);       
    }//GEN-LAST:event_OneSevenActionPerformed

    private void ZeroSevenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ZeroSevenActionPerformed
        identifyState(0, 7);       
    }//GEN-LAST:event_ZeroSevenActionPerformed

    private void moveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moveButtonActionPerformed
        gameState = 1;
    }//GEN-LAST:event_moveButtonActionPerformed

    private void undoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_undoButtonActionPerformed
        // gameState = 3;
    }//GEN-LAST:event_undoButtonActionPerformed

    private void scoreButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_scoreButtonActionPerformed
        // gameState = 4;
    }//GEN-LAST:event_scoreButtonActionPerformed

    private void iForfeitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_iForfeitActionPerformed
        System.exit(0);// exits the game 
    }//GEN-LAST:event_iForfeitActionPerformed

    private void helpButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_helpButtonActionPerformed
        // gameState = 5;
    }//GEN-LAST:event_helpButtonActionPerformed
// </editor-fold>
   
    javax.swing.ImageIcon WhitePawn;
    javax.swing.ImageIcon WhiteKnight;
    javax.swing.ImageIcon WhiteRook;
    javax.swing.ImageIcon WhiteBishop;
    javax.swing.ImageIcon WhiteQueen;
    javax.swing.ImageIcon WhiteKing;
    
    javax.swing.ImageIcon BlackPawn;
    javax.swing.ImageIcon BlackKnight;
    javax.swing.ImageIcon BlackRook;
    javax.swing.ImageIcon BlackBishop;
    javax.swing.ImageIcon BlackQueen;
    javax.swing.ImageIcon BlackKing;
    
    /**
     * 
     * This function loads all piece icons from files and stores them locally.
     * 
     * @author Anthony Hilyard
     */    
    private void loadIcons()
    {
        WhitePawn = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/White-Pawn.png"));
        WhiteKnight = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/White-Knight.png"));
        WhiteRook = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/White-Rook.png"));
        WhiteBishop = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/White-Bishop.png"));
        WhiteQueen = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/White-Queen.png"));
        WhiteKing = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/White-King.png"));
        
        BlackPawn = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/Black-Pawn.png"));
        BlackKnight = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/Black-Knight.png"));
        BlackRook = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/Black-Rook.png"));
        BlackBishop = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/Black-Bishop.png"));
        BlackQueen = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/Black-Queen.png"));
        BlackKing = new javax.swing.ImageIcon(getClass().getResource("/chess/icons/Black-King.png"));        
    }
       
    /**
     * 
     * This function updates a button to show an image of the given piece.
     * 
     * @author Anthony Hilyard
     * @param button The button to update.
     * @param piece The piece to show.  Null means show nothing on this button.
     */
    private void updateButton(javax.swing.JButton button, Piece piece)
    {
        if(piece == null)
        {
            button.setIcon(null);
        }
        else
        {
            switch(piece.getType())
            {
                case 'P':
                    if(piece.getColor() == 1)
                    {
                        button.setIcon(WhitePawn);
                    }
                    else
                    {
                         button.setIcon(BlackPawn);
                    }
                    break;            
                case 'N':
                    if(piece.getColor() == 1)
                    {
                        button.setIcon(WhiteKnight);
                    }
                    else
                    {
                         button.setIcon(BlackKnight);
                    }
                    break;  
                case 'R':
                    if(piece.getColor() == 1)
                    {
                        button.setIcon(WhiteRook);
                    }
                    else
                    {
                         button.setIcon(BlackRook);
                    }
                    break;  
                case 'B':
                    if(piece.getColor() == 1)
                    {
                        button.setIcon(WhiteBishop);
                    }
                    else
                    {
                         button.setIcon(BlackBishop);
                    }
                    break;  
                case 'Q':
                    if(piece.getColor() == 1)
                    {
                        button.setIcon(WhiteQueen);
                    }
                    else
                    {
                         button.setIcon(BlackQueen);
                    }
                    break;  
                case 'K':
                    if(piece.getColor() == 1)
                    {
                        button.setIcon(WhiteKing);
                    }
                    else
                    {
                         button.setIcon(BlackKing);
                    }
                    break;  
            }
        }
    }
    // <editor-fold defaultstate="collapsed" desc="displayBoard">   
    /**
     * 
     * This function updates each button of the board, one at a time.
     * 
     * @author davondunajski
     * @author Anthony Hilyard
     */
    private void displayBoard()
    {     
        if(theGameBoard == null)
            return;
        
        updateButton(ZeroZero,theGameBoard.getPiece(0,0));
        updateButton(OneZero,theGameBoard.getPiece(1,0));
        updateButton(TwoZero,theGameBoard.getPiece(2,0));
        updateButton(ThreeZero,theGameBoard.getPiece(3,0));
        updateButton(FourZero,theGameBoard.getPiece(4,0));
        updateButton(FiveZero,theGameBoard.getPiece(5,0));
        updateButton(SixZero,theGameBoard.getPiece(6,0));
        updateButton(SevenZero,theGameBoard.getPiece(7,0));
        updateButton(ZeroOne,theGameBoard.getPiece(0,1));
        updateButton(ZeroTwo,theGameBoard.getPiece(0,2));
        updateButton(ZeroThree,theGameBoard.getPiece(0,3));
        updateButton(ZeroFour,theGameBoard.getPiece(0,4));
        updateButton(ZeroFive,theGameBoard.getPiece(0,5));
        updateButton(ZeroSix,theGameBoard.getPiece(0,6));
        updateButton(ZeroSeven,theGameBoard.getPiece(0,7));
        updateButton(OneOne,theGameBoard.getPiece(1,1));
        updateButton(OneTwo,theGameBoard.getPiece(1,2));
        updateButton(OneThree,theGameBoard.getPiece(1,3));
        updateButton(OneFour,theGameBoard.getPiece(1,4));
        updateButton(OneFive,theGameBoard.getPiece(1,5));
        updateButton(OneSix,theGameBoard.getPiece(1,6));
        updateButton(OneSeven,theGameBoard.getPiece(1,7));
        updateButton(TwoOne,theGameBoard.getPiece(2,1));
        updateButton(TwoTwo,theGameBoard.getPiece(2,2));
        updateButton(TwoThree,theGameBoard.getPiece(2,3));
        updateButton(TwoFour,theGameBoard.getPiece(2,4));
        updateButton(TwoFive,theGameBoard.getPiece(2,5));
        updateButton(TwoSix,theGameBoard.getPiece(2,6));
        updateButton(TwoSeven,theGameBoard.getPiece(2,7));
        updateButton(ThreeOne,theGameBoard.getPiece(3,1));
        updateButton(ThreeTwo,theGameBoard.getPiece(3,2));
        updateButton(ThreeThree,theGameBoard.getPiece(3,3));
        updateButton(ThreeFour,theGameBoard.getPiece(3,4));
        updateButton(ThreeFive,theGameBoard.getPiece(3,5));
        updateButton(ThreeSix,theGameBoard.getPiece(3,6));
        updateButton(ThreeSeven,theGameBoard.getPiece(3,7));
        updateButton(FourOne,theGameBoard.getPiece(4,1));
        updateButton(FourTwo,theGameBoard.getPiece(4,2));
        updateButton(FourThree,theGameBoard.getPiece(4,3));
        updateButton(FourFour,theGameBoard.getPiece(4,4));
        updateButton(FourFive,theGameBoard.getPiece(4,5));
        updateButton(FourSix,theGameBoard.getPiece(4,6));
        updateButton(FourSeven,theGameBoard.getPiece(4,7));
        updateButton(FiveOne,theGameBoard.getPiece(5,1));
        updateButton(FiveTwo,theGameBoard.getPiece(5,2));
        updateButton(FiveThree,theGameBoard.getPiece(5,3));
        updateButton(FiveFour,theGameBoard.getPiece(5,4));
        updateButton(FiveFive,theGameBoard.getPiece(5,5));
        updateButton(FiveSix,theGameBoard.getPiece(5,6));
        updateButton(FiveSeven,theGameBoard.getPiece(5,7));
        updateButton(SixOne,theGameBoard.getPiece(6,1));
        updateButton(SixTwo,theGameBoard.getPiece(6,2));
        updateButton(SixThree,theGameBoard.getPiece(6,3));
        updateButton(SixFour,theGameBoard.getPiece(6,4));
        updateButton(SixFive,theGameBoard.getPiece(6,5));
        updateButton(SixSix,theGameBoard.getPiece(6,6));
        updateButton(SixSeven,theGameBoard.getPiece(6,7));
        updateButton(SevenOne,theGameBoard.getPiece(7,1));
        updateButton(SevenTwo,theGameBoard.getPiece(7,2));
        updateButton(SevenThree,theGameBoard.getPiece(7,3));
        updateButton(SevenFour,theGameBoard.getPiece(7,4));
        updateButton(SevenFive,theGameBoard.getPiece(7,5));
        updateButton(SevenSix,theGameBoard.getPiece(7,6));
        updateButton(SevenSeven,theGameBoard.getPiece(7,7));
        
    }
    // </editor-fold>
    
    private static Board theGameBoard;
    private static MyForm theGUI;
    private static int previousX,previousY,toX,toY;
    private static int gameState;
    private static int playerTurn =0;
    boolean moveIsValid = true;
     //   private int playerTurn = 0;// makes the intial player the white player
      //  boolean moveIsValid = true;
    public static void main(String[] args)
    {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MyForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MyForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MyForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MyForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>



        theGameBoard = new Board();
        theGUI = new MyForm();

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() 
        {
            public void run() 
            {
               theGUI.setVisible(true);
               theGUI.displayBoard();
           }      
        });
        
        int playerTurn = 0;// makes the intial player the white player
        boolean moveIsValid = true;
        
       // String commandRequest = "";
        /**
             @author DavonDunajski*/
        while (/* commandRequest != null */ 1 == 1)
        {
            theGUI.displayBoard();
            
//            switch (commandRequest) 
//            {
//                case "1":
//                    // makeMove( );
//                    if (moveIsValid == true)
//                    {
//                        playerTurn++; /**after a successful move the playerTurn is increased, from here after
//                         * whites turn will be an even number and black and odd number
//                         * @author Davon Dunajski*/
//                    }
//                    break;
//
//                case "2":
//                {
//                    //computeScore ();//calls a function to look at the current pieces and compute scores based on what's missing @author DavonDunajski
//                }   
//                    break;
//
//                case "3":
//                {   
//                    // undoLastMove ( ) ;// calls a function to undo the last stack of the game state @author DavonDunajski
//                }   
//                    break;
//
//                case "4":
//                {   
//                    System.exit(0);// exits the game @author DavonDunajski
//                }   
//                    break;
//
//                case "5":
//                {
//                    //userNeedsHelp(); // calls the help function @author DavonDunajski
//                }   
//                    break;
//            }
//            
//            commandRequest = "";
        }
    }

    /**
     *
     * @param x
     * @param y
     */
    public void identifyState(int x,int y)
    {
        outputMessageBoard.setText("(" + String.valueOf(x) + "," + String.valueOf(y) + ")");
        
         if (gameState ==1)
        {
            previousX = x;
            previousY = y;
            gameState = 2;
        }
        if (gameState ==2)
        {
            toX = x;
            toY = y;
            //moveIsValid = makeMove(previousX,previousY,toX,toY);
            if (moveIsValid)
            {
                playerTurn = 1 - playerTurn;
                gameState = 0;
            }
            else
            {
                outputMessageBoard.setText("That move is invalid, please try again");
                gameState=1;
            }
        }
    }  
    
    static boolean makeMove(int sourceX, int sourceY, int destinationX, int destinationY)
    {
            boolean moveIsValid = false;
            Piece pieceType = theGameBoard.getPiece(sourceX, sourceY);


            //check if the move is valid
            while(moveIsValid == false)
            {
                    if((isValidMove(sourceX, sourceY, destinationX, destinationY)) == true)
                    {
                            moveIsValid = true;
                    }// end if isValidMove
                    else
                    {

                            outputMessageBoard.setText("That move is not valid.");
                    }// end else isValidMove
            }//end while moveIsValid

            if (moveIsValid == true)
            {
                    if (theGameBoard.getPiece(destinationX, destinationY) != null)
                    {

                            outputMessageBoard.setText("You captured the other players"+theGameBoard.getPiece(destinationX,destinationY).getType());	
                    }//end if isValidMove
                    theGameBoard.setPiece(destinationX, destinationY, pieceType);
                    theGameBoard.removePiece(sourceX, sourceY);

            }//end if isValidMove 
            outputMessageBoard.setText("You have completed your turn");
            //BoardStack.push(theGameBoard.getCopy());
            return moveIsValid;
                               
        }// end makeMove

/******************************************************************************/

	/**
	* @author JimmyRoeder
	* @author MarkSteiger
	* @return returns the last state of the board by popping it off of the stack
	*/

	/*static Board undoLastMove()
	{
		return Board previousGameBoard = BoardStack.pop();
	}//end undoLastMove*/

/******************************************************************************/
        /**isValidMove
         * This function receives the coordinates for a piece and the coordinates
         * for its proposed destination. It returns whether or not the move is a
         * valid one. If the source Piece belongs to the current player, the
         * destination is a valid one, AND the move will not cause the current
         * player to be in check, the function returns true.
         * @param sourceX The x-coordinate of the piece to move
         * @param sourceY The y-coordinate of the piece to move
         * @param destinationX The x-coordinate of the destination
         * @param destinationY The y-coordinate of the destination
         * @return True if it's a valid move, false if the move is invalid for
         *      any reason.
         * @author Mark McDonald
         * @author Alex Kygar
         */
        static boolean isValidMove (int sourceX, int sourceY, int destinationX, int destinationY)
        {
            if (isCurrentPlayersPiece (sourceX, sourceY) &&
                isValidDestination (sourceX, sourceY, destinationX, destinationY, theGameBoard))
            {   
                if (willCauseCheck (sourceX, sourceY, destinationX, destinationY))
                    return false;
                else
                    return true;
            }
            else
                return false;
        }//end of isValidMove
        
/******************************************************************************/
        /**isCurrentPlayersPiece
         * This function receives the coordinates and Board object. It returns
         * whether or not the Piece at those coordinates matches the current
         * player's color. If the Piece belongs to the opposing player or does
         * not exist, the function returns false.
         * @param sourceX The X value of the source square.
         * @param sourceY The Y value of the source square.  
         * @return true if the color of the piece matches the player's piece,
         *          false other wise.
         * @author MarkMcDonald
         * @author Yi Zheng
         * @author AlexKygar
         */
        static boolean isCurrentPlayersPiece (int sourceX, int sourceY)
        {
            boolean isCorrectPlayer = false; //assume piece is invalid
            Piece currentPiece = theGameBoard.getPiece(sourceX, sourceY);
            if (currentPiece != null) //the piece exists
            {
                //check if it matches the current player
                isCorrectPlayer = (currentPiece.getColor() == playerTurn);
            }
            return isCorrectPlayer;    
        }//end of isCurrentPlayersPiece
      
        
/******************************************************************************/
        /** isValidDestination
         * This function tests if the destination is a valid square. 
         * It then calls canMove in piece to make sure the move is a valid move 
         * for the piece type. 
         * It then checks to make sure the destination piece, if there is one,
         * is a different color than the source piece.
         * Then it checks to see if there are any pieces in between the source 
         * square and destination square(except for knights and pawns).
         * @param sourceX The X value of the source square.
         * @param sourceY The Y value of the source square.
         * @param destinationX The X value of the destination square.
         * @param destinationY The Y value of the destination square.
         * @param gameBoard The instance of Board used to check if valid move.
         * @return True if the destination if valid and the move is valid.
         *      otherwise it returns false.
         * @author AlexKygar
         * @author Yi Zheng
         * @author Mark McDonald
         */
        static boolean isValidDestination (int sourceX, int sourceY, 
                int destinationX, int destinationY, Board gameBoard)
        {       
        
            Piece currentPiece;
            currentPiece = gameBoard.getPiece(sourceX, sourceY);
            /**stillValid is a boolean that will remain true as long as each check 
             * passes but if a check fails it becomes false
             * and no other functions will be ran. Is returned at end of function
             @author AlexKygar*/
            boolean stillValid = true;
            
            /**Tests to make sure the destination square is a valid square.
             * @author AlexKygar*/
            if (destinationX<0 || destinationX>7 || destinationY<0 || destinationY>7)
                stillValid = false;
            
            /**This if statement is true if the piece is a pawn. Inside the if 
             * statement tests to make sure the pawn is making a valid move
             * @author AlexKygar*/
            if(stillValid)
              {
                  int result = currentPiece.canMove(sourceX, sourceY, 
                          destinationX, destinationY);
                  
                  if (result==0)/**The move was deemed inValid.*/
                  {
                      stillValid=false;
                  }
                  else if (result==1)/**The move was deemed Valid*/
                  {
                      /**This makes sure there is no piece in front of the
                       * pawn since its moving forward.*/
                      if (currentPiece.getType()=='P'&& 
                              gameBoard.getPiece(destinationX, destinationY)!=null)
                      {
                          stillValid=false;
                      }
                  }
                  /**This means the piece is a pawn moving diagonally so it 
                   * checks to make sure there is a piece at the destination.
                   * whether the piece is the opposite color or not is check in 
                   * in the next if.*/
                  else if (result==2)
                  {
                      if (gameBoard.getPiece(destinationX, destinationY)==null)
                          stillValid=false;
                  }
              }
            
            /**This checks to see if the destination piece,if there is one, is
             * the same color as the source piece. If they are the same the
             * destination is invalid so stillValid is changed to false.
             * @author AlexKygar*/
            if (stillValid)
            {
                Piece destinationPiece = gameBoard.getPiece(destinationX, destinationY);
                if (currentPiece.getColor()==destinationPiece.getColor())
                    stillValid=false;
            }
            
            /**This if statement checks to see if the piece is a pawn or knight 
             * it is false if the piece is either one
             * @author AlexKygar*/
            if (stillValid && currentPiece.getType()!='P' 
                    && currentPiece.getType()!='N')
            {
                int changeInX;
                int changeInY;
                
                /**Determines the change in X
                @author AlexKygar*/
                if (sourceX-destinationX<0)
                    changeInX = 1;
                else if (sourceX-destinationX>0)
                    changeInX = -1;
                else
                    changeInX = 0;
                
                /**Determines the change in Y
                 @author AlexKygar*/
                 if (sourceY-destinationY<0)
                    changeInY = 1;
                else if (sourceY-destinationY>0)
                    changeInY = -1;
                else
                    changeInY = 0;
                 
                /** iterX and iterY are the incremental variables used to check 
                 * each square between the source and destination
                 * they are initiated at the next square after the source
                 * @author AlexKygar*/
                int iterX = sourceX + changeInX;
                int iterY = sourceY + changeInY;
                
                /**This while checks each square between the source and 
                 * destination for a piece, if there is a piece at any square
                 * stillValid is set to false and the while exits.
                 * @author AlexKygar*/
                while (stillValid && iterX!=destinationX && iterY!=destinationY)
                {

                    if (gameBoard.getPiece(iterX, iterY)!= null)

                        stillValid=false;
                    
                    iterX = iterX + changeInX;
                    iterY = iterY + changeInY;
                }
            }
            
            //return stillValid;
            return true;
        }//end of isValidDestination
        
/******************************************************************************/
        /** willCauseCheck
         * This function receives source and destination coordinates for the
         * intended move, as well as the current Board object.
         * It returns a boolean value indicating whether or not making the move
         * will put the current player in check.
         * @author MarkMcDonald
         * @author Yi Zheng 
         * @author AlexKygar
         */
        static boolean willCauseCheck (int sourceX, int sourceY, int destX, int destY)
        {
            
            //make a copy of the board
            Board tempBoard = theGameBoard.getCopy();
            
            //make the move on tempBoard
            tempBoard.setPiece(destX, destY, theGameBoard.getPiece(sourceX, sourceY));
            tempBoard.removePiece(sourceX, sourceY);
            
            //check if tempBoard is now in check    
            return isInCheck(tempBoard);
        }//end of willCauseCheck
        
/******************************************************************************/
    /** isInCheck
    * Based on a board state passed in it will determine if the current
    * players king is in check on that board.
    *
    * Functionality is commented out until its dependents are solved.
    *
    * @author Tanis Irwin
    * @author Cody Paulson
    */
    public static boolean isInCheck(Board board)
    {
        boolean inCheck = false; //not in check by default
        int[] kingLoc = {0, 0}; //array of size 2; x, y coords
        
        findKing(board, kingLoc);//locate the king
        
        Piece whoDis = null;//place holder piece
        
        for(int i = 0; i < 8; i++)// i is current direction, 0 = north, progressing clockwise
        {
            int j = 1;//used to increment parsing
            switch( i )
            {
                case 0://check North bound path
                    while((kingLoc[1]+j) < 8)//don't leave board boundries
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0], kingLoc[1]+j);
                        
                        if((whoDis != null) && (whoDis.getColor() != playerTurn))
                        {//piece exists AND is enemy
                            if(isValidDestination(kingLoc[0], kingLoc[1]+j, kingLoc[0], kingLoc[1], board))
                            {//enemy can hit king
                                inCheck = true;
                                break;
                            }//if
                        }//if
                        j++;
                    }//while
                    
                    //check for a specific knight
                    if(((kingLoc[0]+1) < 8) && ((kingLoc[1]+2) < 8)) //don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]+1, kingLoc[1]+2);
                        
                        if((whoDis != null) && 
                            (whoDis.getColor() != playerTurn) && 
                            (whoDis.getType() == 'N'))
                        {//piece exists, is enemy, and is a knight
                            inCheck = true;
                        }//if
                    }//if
                    break;
                    
                case 1://check North-East bound path
                    while(((kingLoc[0]+j) < 8) && ((kingLoc[1]+j) < 8))//don't exit board
                    {
                        //check location for piece
                        whoDis = board.getPiece(kingLoc[0]+j, kingLoc[1]+j);
                        
                        if((whoDis != null) && (whoDis.getColor() != playerTurn))
                        {//piece exists AND is enemy
                            if(isValidDestination(kingLoc[0]+j, kingLoc[1]+j, kingLoc[0], kingLoc[1], board))
                            {//enemy can hit king
                                inCheck = true;
                                break;
                            }//if
                        }//if
                        j++;
                    }//while
                    
                    //check for a specific knight
                    if(((kingLoc[0]+2) < 8) && ((kingLoc[1]+1) < 8))//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]+2, kingLoc[1]+1);
                        
                        if((whoDis != null) && 
                            (whoDis.getColor() != playerTurn) &&
                            (whoDis.getType() == 'N'))
                        {//piece exists, is enemy, and a knight
                            inCheck = true;
                        }//if
                    }//if
                    break;
                
                case 2://check East bound path
                    while((kingLoc[0]+j) < 8)//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]+j, kingLoc[1]);
                        
                        if((whoDis != null) && (whoDis.getColor() != playerTurn))
                        {//piece exists AND is enemy
                            if(isValidDestination(kingLoc[0]+j, kingLoc[1], kingLoc[0], kingLoc[1], board))
                            {//enemy can hit king
                                inCheck = true;
                                break;
                            }//if
                        }//if
                        j++;
                    }//end while
                    
                    //check for a specific knight
                    if(((kingLoc[0]+2) < 8) && ((kingLoc[1]-1) < 8))//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]+2, kingLoc[1]-1);
                        
                        if((whoDis != null) &&
                            (whoDis.getColor() != playerTurn) &&
                            (whoDis.getType() == 'N'))
                        {//piece exists, is enemy, and is a knight
                            inCheck = true;
                        }//if
                    }//if
                    break;
                    
                case 3://check South-East bound path
                    while(((kingLoc[0]+j) < 8) && ((kingLoc[1]-j) < 8))//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]+j, kingLoc[1]-j);
                        
                        if((whoDis != null) && (whoDis.getColor() != playerTurn))
                        {//piece exists AND is enemy
                            if(isValidDestination(kingLoc[0]+j, kingLoc[1]-j, kingLoc[0], kingLoc[1], board))
                            {//enemy can hit king
                                inCheck = true;
                                break;
                            }//if
                        }//if
                        j++;
                    }//end while
                    
                    //check for a specific knight
                    if(((kingLoc[0]+1) < 8) && ((kingLoc[1]-2) < 8))//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]+1, kingLoc[1]-2);
                        
                        if((whoDis != null) &&
                            (whoDis.getColor() != playerTurn) &&
                            (whoDis.getType() == 'N'))
                        {//piece exists, is enemy, and is a knight
                            inCheck = true;
                        }//if
                    }//if
                    break;
                    
                case 4://check South bound path
                    while((kingLoc[1]-j) < 8)//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0], kingLoc[1]-j);
                        
                        if((whoDis != null) && (whoDis.getColor() != playerTurn))
                        {//piece exists AND is enemy
                            if(isValidDestination(kingLoc[0], kingLoc[1]-j, kingLoc[0], kingLoc[1], board))
                            {//enemy can hit king
                                inCheck = true;
                                break;
                            }//if
                        }//if
                        j++;
                    }//end while
                    
                    //check for a specific knight
                    if(((kingLoc[0]-1) < 8) && ((kingLoc[1]-2) < 8))//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]-1, kingLoc[1]-2);
                        
                        if((whoDis != null) &&
                            (whoDis.getColor() != playerTurn) &&
                            (whoDis.getType() == 'N'))
                        {//piece exists, is enemy, and is a knight
                            inCheck = true;
                        }//if
                    }//if
                    break;
                    
                case 5://check South-West bound path
                    while(((kingLoc[0]-j) < 8) && ((kingLoc[1]-j) < 8))//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]-j, kingLoc[1]-j);
                        
                        if((whoDis != null) && (whoDis.getColor() != playerTurn))
                        {//piece exists AND is enemy
                            if(isValidDestination(kingLoc[0]-j, kingLoc[1]-j, kingLoc[0], kingLoc[1], board))
                            {//enemy can hit king
                                inCheck = true;
                                break;
                            }//if
                        }//if
                        j++;
                    }//end while
                    
                    //check for a specific knight
                    if(((kingLoc[0]-2) < 8) && ((kingLoc[1]-1) < 8))//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]-2, kingLoc[1]-1);
                        
                        if((whoDis != null) &&
                            (whoDis.getColor() != playerTurn) &&
                            (whoDis.getType() == 'N'))
                        {//piece exists, is enemy, and is a knight
                            inCheck = true;
                        }//if
                    }//if
                    break;
                    
                case 6://check West bound path
                    while((kingLoc[0]-j) < 8)//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]-j, kingLoc[1]);
                        
                        if((whoDis != null) && (whoDis.getColor() != playerTurn))
                        {//piece exists AND is enemy
                            if(isValidDestination(kingLoc[0]-j, kingLoc[1], kingLoc[0], kingLoc[1], board))
                            {//enemy can hit king
                                inCheck = true;
                                break;
                            }//if
                        }//if
                        j++;
                    }//end while
                    
                    //check for a specific knight
                    if(((kingLoc[0]-2) < 8) && ((kingLoc[1]+1) < 8))//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]-2, kingLoc[1]+1);
                        
                        if((whoDis != null) &&
                            (whoDis.getColor() != playerTurn) &&
                            (whoDis.getType() == 'N'))
                        {//piece exists, is enemy, and is a knight
                            inCheck = true;
                        }//if
                    }//if
                    break;
                
                case 7://check North-West bound path
                    while(((kingLoc[0]-j) < 8) && ((kingLoc[1]+j) < 8))//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]-j, kingLoc[1]+j);
                        
                        if((whoDis != null) && (whoDis.getColor() != playerTurn))
                        {//piece exists AND is enemy
                            if(isValidDestination(kingLoc[0]-j, kingLoc[1]+j, kingLoc[0], kingLoc[1], board))
                            {//enemy can hit king
                                inCheck = true;
                                break;
                            }//if
                        }//if
                        j++;
                    }//end while
                    
                    //check for a specific knight
                    if(((kingLoc[0]-1) < 8) && ((kingLoc[1]+2) < 8))//don't leave board
                    {
                        //check location for a piece
                        whoDis = board.getPiece(kingLoc[0]-1, kingLoc[1]+2);
                        
                        if((whoDis != null) &&
                            (whoDis.getColor() != playerTurn) &&
                            (whoDis.getType() == 'N'))
                        {//piece exists, is enemy, and is a knight
                            inCheck = true;
                        }//if
                    }//if
                    break;
            }//end of switch
            //when current case has finished, if a check occured, don't check more cases
         	if(inCheck)
         	    break;
        }//end of for
        return inCheck;
    }//end of isInCheck
/******************************************************************************/
    /** isInCheckMate
    * It will check if the current active board is in a checkmate status.
    * 
    * @author Tanis Irwin
    * @author Cody Paulson
    */
    public static boolean isInCheckMate()
    {
        boolean checkMate = true; //default

	    int [] kingLoc = {0, 0};
        findKing(theGameBoard, kingLoc);

        int [] threatLoc = {0, 0};
        findThreat(theGameBoard, threatLoc, kingLoc[0], kingLoc[1]);

        if(canMoveKing(kingLoc[0], kingLoc[1]))
        {
	        //found a way to move the king out of check
	        checkMate = false;
        }
        else if(canDestroyPiece(threatLoc[0], threatLoc[1]))
        {
	        //found a way to destroy a piece putting us in check
	        checkMate = false;
        }
        else if(canBlockPiece(threatLoc[0], threatLoc[1], kingLoc[0], kingLoc[1]))
        {
        	//found a way to block a piece putting us in check
        	checkMate = false;
        }//if

        return checkMate;
    }//end of isInCheckMate
/******************************************************************************/
    /** canMoveKing
    * Helper function for checkmate.
    * Used to determine if the current player can move their king
    * in such a way to remove themselves from check.
    *
    * @author Tanis Irwin
    * @author Cody Paulson
    */
    private static boolean canMoveKing(int kingX, int kingY)
    {
    	boolean isPossible = false; //true if king can move to safety, false if not
	
	    for(int i = 0; i < 8; i++)// i is the current direction, starting with �north� progressing clockwise
    	{
    		switch( i )//iterate through each case of king movement
    		{
    			case 0://call for x+0, y+1 �North�
    				if(isValidDestination(kingX, kingY, kingX+0, kingY+1, theGameBoard))
    				{//king can move to location
    					if(!(willCauseCheck(kingX, kingY, kingX+0, kingY+1)))
    					{
    						isPossible = true;
    					}//if
    				}//if
    				break;

    			case 1://call for x+1, y+1 �NE�
                    if(isValidDestination(kingX, kingY, kingX+1, kingY+1, theGameBoard))
    				{//king can move to location
    					if(!(willCauseCheck(kingX, kingY, kingX+1, kingY+1)))
    					{//making the move is safe
    						isPossible = true;
    					}//if
    				}//if
    				break;

    			case 2://call for x+1, y+0 �East�
                    if(isValidDestination(kingX, kingY, kingX+1, kingY+0, theGameBoard))
    				{//king can move to location
    					if(!(willCauseCheck(kingX, kingY, kingX+1, kingY+0)))
    					{//making the move is safe
    						isPossible = true;
    					}//if
    				}//if
    				break;

    			case 3://call for x+1, y-1 �SE�
                    if(isValidDestination(kingX, kingY, kingX+1, kingY-1, theGameBoard))
    				{//king can move to location
    					if(!(willCauseCheck(kingX, kingY, kingX+1, kingY-1)))
    					{//making the move is safe
    						isPossible = true;
    					}//if
    				}//if
    				break;

    			case 4://call for x+0, y-1 �South�
                    if(isValidDestination(kingX, kingY, kingX+0, kingY-1, theGameBoard))
    				{//king can move to location
    					if(!(willCauseCheck(kingX, kingY, kingX+0, kingY-1)))
    					{//making the move is safe
    						isPossible = true;
    					}//if
    				}//if
    				break;

    			case 5://call for x-1, y-1 �SW�
                    if(isValidDestination(kingX, kingY, kingX-1, kingY-1, theGameBoard))
    				{//king can move to location
    					if(!(willCauseCheck(kingX, kingY, kingX-1, kingY-1)))
    					{//making the move is safe
    						isPossible = true;
    					}//if
    				}//if
    				break;

    			case 6://call for x-1, y+0 �West�
                    if(isValidDestination(kingX, kingY, kingX-1, kingY+0, theGameBoard))
    				{//king can move to location
    					if(!(willCauseCheck(kingX, kingY, kingX-1, kingY+0)))
    					{//making the move is safe
    						isPossible = true;
    					}//if
    				}//if
    				break;

			    case 7://call for x-1, y+1 �NW�
                    if(isValidDestination(kingX, kingY, kingX-1, kingY+1, theGameBoard))
    			    {//king can move to location
    					if(!(willCauseCheck(kingX, kingY, kingX-1, kingY+1)))
    					{//making the move is safe
    						isPossible = true;
    					}//if
    				}//if
    				break;
    		}//switch
    		if(isPossible)//if find a way out before loop finishes, break
    			break;
	    }//for

	    return isPossible;
    }//end canMoveKing
/******************************************************************************/
    /** canDestroyPiece
    * Helper function for checkmate.
    * Used to determine if the current player can destroy an enemy
    * piece such that it removes themselves from check.
    *
    * @author Tanis Irwin
    * @author Cody Paulson
    */
    private static boolean canDestroyPiece(int threatX, int threatY)
    {
        boolean isPossible = false; //true if piece can be destroyed, false if not
	
	    Piece currentPiece = null;	

	    //parse board for own piece
	    for(int y = 0; y < 8; y++)
	    {//up one y for every eight x locations
		    for(int x = 0; x < 8; x++)
		    {
			    //check location for a piece
			    currentPiece = theGameBoard.getPiece(x, y);
			
			    if((currentPiece != null) && (currentPiece.getColor() == playerTurn))
			    {//exists AND is yours
				    if(isValidDestination(x, y, threatX, threatY, theGameBoard))
				    {//your piece can destroy enemy threat
					    if(!(willCauseCheck(x, y, threatX, threatY)))
					    {//making the move is safe
						    isPossible = true;
					    }//if
				    }//if
			    }//if
		    }//for
            if(isPossible)
                break;
	    }//for

	    return isPossible;
    }
/******************************************************************************/
    /** canBlockPiece
    * Helper function for checkmate.
    * Used to determine if the current player can move one of their
    * own pieces such that it blocks the path of an enemy piece
    * to remove themselves from check.
    *
    * @author Tanis Irwin
    * @author Cody Paulson
    */
    private static boolean canBlockPiece(int threatX, int threatY,
                                        int kingX, int kingY)
    {
    	boolean isPossible = false; //true if player can block, false if not
	    Piece currentPiece = theGameBoard.getPiece(threatX,threatY);
        
	    switch(currentPiece.getType())
	    {
    		case 'R':
                if (kingY< threatY&& kingY+1!=threatY)
    			{
    			    for( int i=kingY+1; i< threatY&& i<8; i++)
    			    {
    				    if(  theGameBoard.getPiece(kingX, i)==null)
    				    {
    					    for(int y = 0; y < 8; y++)
    						{//up one y for every eight x locations
    						    for(int x = 0; x < 8; x++)
    						    {
    							    if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
    						        {
    							        if(isValidDestination( x,y,kingX,i,theGameBoard))
    							        {
    								        if(willCauseCheck(x,y,kingX,i))
    										    isPossible=true;
    							        }// end of if
    						        }//end of if
    							    if(isPossible)
    								    break;
    						    }//end of x  for
    						    if(isPossible)
    							    break;
                            }//end of y  for  
    				    }// end of if
    				    if(isPossible)
    					    break;
    			    }// end of up for loop
                }//end of if
                else if(kingX<threatX &&kingX+1!=threatX )
                {
                    for( int i=kingX+1; i< threatX&& i<8;i++)
                    {
    	                if( theGameBoard.getPiece(i,kingY)==null )
    	                {
    					    for(int y = 0; y < 8; y++)
    						{//up one y for every eight x locations
    						    for(int x = 0; x < 8; x++)
    						    {
    							    if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
    						        {
    							        if(isValidDestination( x,y,kingX,i,theGameBoard))
    							        {
    								        if(willCauseCheck(x,y,kingX,i))
    										    isPossible=true;
    							        }// end of if
    						        }//end of if
    				                if(isPossible)
    								    break ;
    						    }//end of x  for
    			                if(isPossible)
    							    break ;
                            }//end of y  for  
    	                }//end of if
    				    if(isPossible)
    					    break;
                    }//end of right for loop
                }
    			else if( kingY>threatY && kingY-1!=threatY)
                {
                    for(int i=kingY-1;i>threatY&& i>-1;i--)
                    {
                        if(  theGameBoard.getPiece(kingX, i)==null)
                        {
    					    for(int y = 0; y < 8; y++)
    						{//up one y for every eight x locations
    						    for(int x = 0; x < 8; x++)
    						    {
    							    if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
    						        {
    							        if(isValidDestination( x,y,kingX,i,theGameBoard))
    							        {
    								        if(willCauseCheck(x,y,kingX,i))
    										    isPossible=true;
    							        }// end of if
    						        }//end of if
    				                if(isPossible)
    								    break ;
    						    }//end of x for
    			                if(isPossible)
    							    break ;
    						}// end of y for 
    				    }// end of if
    				    if(isPossible)
    					    break;	
                    }// end of down for loop
                }
    			else if( threatX<kingX&& threatX!= kingX-1)
                {
                    for( int i=kingX-1; i> threatX&& i>-1;i--)
                    {
    	                if( theGameBoard.getPiece(i,kingY)==null)
    	                {
    					    for(int y = 0; y < 8; y++)
    						{//up one y for every eight x locations
    						    for(int x = 0; x < 8; x++)
    						    {
    							    if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
    						        {
    							        if(isValidDestination( x,y,kingX,i,theGameBoard))
    							        {
    								        if(willCauseCheck(x,y,kingX,i))
    										    isPossible=true;
    							        }// end of if
    						        }//end of if
    				                if(isPossible)
    								    break ;
    						    }//end of x  for
    			                if(isPossible)
    							    break ;
    						}// end of y for 
    	                }//end of if
    				    if(isPossible)
    					    break;
                    }// end of left for loop
                }
    			break;
		
		case 'B':
			if(threatX>kingX&&threatY>kingY&& threatX!=kingX+1&&threatY!=kingY+1)
			{
			    for( int i=kingX+1; i<threatX&& i<8;i++)
			    {
				    for( int j= kingY+1; j<threatY&& i<8;j++)
				    {
		                if(theGameBoard.getPiece(i,j)==null)
		                {
						    for(int y = 0; y < 8; y++)
						    {//up one y for every eight x locations
						        for(int x = 0; x < 8; x++)
						        {
							        if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						            {
							            if(isValidDestination( x,y,kingX,i,theGameBoard))
							            {
								            if(willCauseCheck(x,y,kingX,i))
										    isPossible=true;
							            }// end of if
						            }//end of if
				                    if(isPossible)
								        break ;
						        }//end of x  for
			                    if(isPossible)
							    break ; 
						    }// end of y for 
				        }//end of if
				        if(isPossible)
					        break;
				    }// end of j for loop right dia 
				    if(isPossible)
					    break;
			    }//end of i for loop right dia
			}//end of if 
			else if(threatX<kingX&&threatY>kingY&& threatX!=kingX-1&&threatY!=kingY+1)
			{
			    for( int i=kingX-1;i>threatX&& i>-1;i--)
			    {
				    for( int j=kingY+1;j<threatY&& j<8;j++)
				    {
		                if(theGameBoard.getPiece(i,j)==null)
		                {
					        for(int y = 0; y < 8; y++)
						    {//up one y for every eight x locations
						        for(int x = 0; x < 8; x++)
						        {
							        if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						            {
							            if(isValidDestination( x,y,kingX,i,theGameBoard))
							            {
								            if(willCauseCheck(x,y,kingX,i))
										        isPossible=true;
							            }// end of if
						            }//end of if
				                    if(isPossible)
								        break ;
			                    }//end of x for
                                if(isPossible)
								    break ;
						    }//end of y for
					    }//end of if
				        if(isPossible)
					        break;
				    }//end of j for loop left dia
                    if(isPossible)
                        break; 
			    }//end of i for loop left dia
			}//end of elif
			else if(threatX<kingX&&threatY<kingY&& threatX!=kingX-1&&threatY!=kingY-1)
			{
                for( int i=kingX-1; i>threatX &&  i>-1;i--)
			    {
				    for( int j=kingY-1; j>threatY && j>-1;j--)
                    {
                        if(theGameBoard.getPiece(i,j)==null)
		                {
						    for(int y = 0; y < 8; y++)
						    {//up one y for every eight x locations
						        for(int x = 0; x < 8; x++)
						        {
							        if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						            {
							            if(isValidDestination( x,y,kingX,i,theGameBoard))
							            {
								            if(willCauseCheck(x,y,kingX,i))
										        isPossible=true;
							            }// end of if
						            }//end of if
				                    if(isPossible)
								    break ;
						        }//end of x for
			                    if(isPossible)
							    break ;
						    }//end of y for
				        }//end of if
				        if(isPossible)
					        break;	
                    }// end of j for loop left dia down
                    if(isPossible)
				        break;		
			    }//end of i for loop left dia down
			}// end of elif
			else if(threatX>kingX&&threatY<kingY&& threatX!=kingX+1&&threatY!=kingY-1)
			{
			    for(int i=kingX+1; i<threatX && i<8;i++)
			    {
				    for( int j= kingY-1; j>threatY && j>-1; j--)
				    {
					    if(theGameBoard.getPiece(i,j)==null)
		                {
						    for(int y = 0; y < 8; y++)
						    {//up one y for every eight x locations
						        for(int x = 0; x < 8; x++)
						        {
							        if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						            {
							            if(isValidDestination( x,y,kingX,i,theGameBoard))
							            {
								            if(willCauseCheck(x,y,kingX,i))
										        isPossible=true;
						  	            }// end of if
						            }//end of if
				                    if(isPossible)
								        break ;
						        }//end of x for
			                    if(isPossible)
							        break ;
						    }//end of y for
				        }//end of if
				        if(isPossible)
					        break;	
				    }// end of j for loop right dia down 
			        if(isPossible)
				        break;	
			    }// end of i for loop right  dia down
			}//end of elif
			break;
            
		case 'Q':
			if (kingY< threatY&& kingY+1!=threatY) //up
			{
			    for( int i=kingY+1; i< threatY&& i<8; i++)
			    {
				    if(  theGameBoard.getPiece(kingX, i)==null)
				    {
					    for(int y = 0; y < 8; y++)
						{//up one y for every eight x locations
						    for(int x = 0; x < 8; x++)
						    {
							    if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						        {
							        if(isValidDestination( x,y,kingX,i,theGameBoard))
							        {
								        if(willCauseCheck(x,y,kingX,i))
										    isPossible=true;
							        }// end of if
						        }//end of if
							    if(isPossible)
								    break;
						    }//end of x  for
						    if(isPossible)
							    break;
                        }//end of y  for  
				    }// end of if
				    if(isPossible)
					    break;
			    }// end of up for loop
            }//end of if
            else if (kingX<threatX &&kingX+1!=threatX )
            {
                for( int i=kingX+1; i< threatX&& i<8;i++)
                {
                	if( theGameBoard.getPiece(i,kingY)==null )
                	{
    					for(int y = 0; y < 8; y++)
    				    {//up one y for every eight x locations
						    for(int x = 0; x < 8; x++)
						    {
							    if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						        {
							        if(isValidDestination( x,y,kingX,i,theGameBoard))
							        {
								        if(willCauseCheck(x,y,kingX,i))
										    isPossible=true;
							        }// end of if	
						        }//end of if
				                if(isPossible)
								    break ;
						    }//end of x  for
			                if(isPossible)
							    break ;
                        }//end of y  for  
	                }//end of if
				    if(isPossible)
					    break;
                }//end of right for loop
            }
            else if( kingY>threatY && kingY-1!=threatY)
            {
                for(int i=kingY-1;i>threatY&& i>-1;i--)
                {
                    if(  theGameBoard.getPiece(kingX, i)==null)
				    {
					    for(int y = 0; y < 8; y++)
						{//up one y for every eight x locations
						    for(int x = 0; x < 8; x++)
						    {
							    if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						        {
							        if(isValidDestination( x,y,kingX,i,theGameBoard))
							        {
								        if(willCauseCheck(x,y,kingX,i))
										    isPossible=true;
							        }// end of if
						        }//end of if
				                if(isPossible)
								    break ;
						    }//end of x for
			                if(isPossible)
							    break ;
						}// end of y for 
				    }// end of if
				    if(isPossible)
					    break;	
                }// end of down for loop
            }
            else if( threatX<kingX&& threatX!= kingX-1)
            {
                for( int i=kingX-1; i> threatX&& i>-1;i--)
                {
	                if( theGameBoard.getPiece(i,kingY)==null)
	                {
					    for(int y = 0; y < 8; y++)
						{//up one y for every eight x locations
						    for(int x = 0; x < 8; x++)
						    {
							    if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						        {
							        if(isValidDestination( x,y,kingX,i,theGameBoard))
							        {
								        if(willCauseCheck(x,y,kingX,i))
										    isPossible=true;
							        }// end of if
						        }//end of if
				                if(isPossible)
								    break ;
						    }//end of x  for
			                if(isPossible)
							    break ;
						}// end of y for 
	                }//end of if
				    if(isPossible)
					    break;
	            }// end of left for loop
            }// end of rook moves
			else if(threatX>kingX&&threatY>kingY&& threatX!=kingX+1&&threatY!=kingY+1)
			{
			    for( int i=kingX+1; i<threatX&& i<8;i++)
			    {
			        for( int j= kingY+1; j<threatY&& i<8;j++)
				    {
		                if(theGameBoard.getPiece(i,j)==null)
		                {
						    for(int y = 0; y < 8; y++)
						    {//up one y for every eight x locations
						        for(int x = 0; x < 8; x++)
						        {
							        if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						            {
							            if(isValidDestination( x,y,kingX,i,theGameBoard))
							            {
								            if(willCauseCheck(x,y,kingX,i))
										    isPossible=true;
							            }// end of if
						            }//end of if
				                    if(isPossible)
								        break ;
						        }//end of x  for
			                    if(isPossible)
							        break ; 
						    }// end of y for 
				        }//end of if
				        if(isPossible)
					        break;
				    }// end of j for loop right dia 
				    if(isPossible)
					    break;
			    }//end of i for loop right dia
			}//end of if 
			else if(threatX<kingX&&threatY>kingY&& threatX!=kingX-1&&threatY!=kingY+1)
			{
			    for( int i=kingX-1;i>threatX&& i>-1;i--)
			    {
				    for( int j=kingY+1;j<threatY&& j<8;j++)
				    {
		                if(theGameBoard.getPiece(i,j)==null)
		                {
					        for(int y = 0; y < 8; y++)
						    {//up one y for every eight x locations
						        for(int x = 0; x < 8; x++)
						        {
							        if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						            {
							            if(isValidDestination( x,y,kingX,i,theGameBoard))
							            {
								            if(willCauseCheck(x,y,kingX,i))
										        isPossible=true;
							            }// end of if
						            }//end of if
				                    if(isPossible)
								    break ;
			                    }//end of x for
                                if(isPossible)
								    break ;
						    }//end of y for
					    }//end of if
				        if(isPossible)
					        break;
				    }//end of j for loop left dia
                    if(isPossible)
                        break; 
			    }//end of i for loop left dia
			}//end of elif
			else if(threatX<kingX&&threatY<kingY&& threatX!=kingX-1&&threatY!=kingY-1)
			{
                for( int i=kingX-1; i>threatX &&  i>-1;i--)
			    {
				    for( int j=kingY-1; j>threatY && j>-1;j--)
                    {
                        if(theGameBoard.getPiece(i,j)==null)
		                {
						    for(int y = 0; y < 8; y++)
						    {//up one y for every eight x locations
						        for(int x = 0; x < 8; x++)
						        {
							        if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
						            {
							            if(isValidDestination( x,y,kingX,i,theGameBoard))
							            {
								            if(willCauseCheck(x,y,kingX,i))
										        isPossible=true;
							            }// end of if
						            }//end of if
				                    if(isPossible)
								        break ;
						        }//end of x for
			                    if(isPossible)
							    break ;
						    }//end of y for
				        }//end of if
				        if(isPossible)
					        break;	
                    }// end of j for loop left dia down
                    if(isPossible)
				        break;		
			    }//end of i for loop left dia down
			}// end of elif
			else if(threatX>kingX&&threatY<kingY&& threatX!=kingX+1&&threatY!=kingY-1)
			{
			    for(int i=kingX+1; i<threatX && i<8;i++)
			    {
    				for( int j= kingY-1; j>threatY && j>-1; j--)
    				{
    					if(theGameBoard.getPiece(i,j)==null)
    		            {
    						for(int y = 0; y < 8; y++)
    						{//up one y for every eight x locations
        						for(int x = 0; x < 8; x++)
        						{
        							if((currentPiece != null) && (currentPiece.getColor()== playerTurn))
        						    {
            							if(isValidDestination( x,y,kingX,i,theGameBoard))
            							{
            								if(willCauseCheck(x,y,kingX,i))
            										isPossible=true;
    							        }// end of if
    								}//end of if
    				                if(isPossible)
    								    break;
    						    }//end of x for
    			                if(isPossible)
    							    break;
    						}//end of y for
    				    }//end of if
    				    if(isPossible)
    					    break;	
    				}// end of j for loop right dia down 
    			    if(isPossible)
    				    break;	
			    }// end of i for loop right  dia down
			}//end of elif
			break;
		}//end of switch
	    
        return isPossible;
    }//end canBlockPiece
/******************************************************************************/
    /** findKing
    * Helper function for check/checkmate functions.
    * Used to find the current players king.
    *
    * @author Tanis Irwin
    * @author Cody Paulson
    */
    private static void findKing(Board board, int[] kingLoc)
    {
        Piece currentPiece = null;
        boolean kingFound = false;
        
        //loop board for current player king
        for(int y = 0; y < 8; y++)
        {//go up y axis once per eight x axis(left to right from bottom to top)
            for(int x = 0; x < 8; x++)
            {
                //check location for a piece
                currentPiece = board.getPiece(x, y);
                
                if(currentPiece != null)
                {//piece exists
                    if((currentPiece.getType() == 'K') && 
                        (currentPiece.getColor() == playerTurn))
                    {//is correct king
                        kingLoc[0] = x;
                        kingLoc[1] = y;
                        kingFound = true;
                        break; //break x for loop
                    }//if
                }//if
            }//for
            if(kingFound)//if x loop was broken
                break;//break y loop too
        }//for
    }//end findKing
/******************************************************************************/
    /** findThreat
    * Helper function for check/checkmate functions.
    * Used to find an enemy threat.
    *
    * @author Tanis Irwin
    * @author Cody Paulson
    */
    private static void findThreat(Board board, int[] threatLoc, int kingX, int kingY)
    {
        Piece currentPiece = null;
        boolean threatFound = false;
        
        //loop board for enemy piece
        for(int y = 0; y < 8; y++)
        {//go up y axis once per eight x axis(left to right from bottom to top)
            for(int x = 0; x < 8; x++)
            {
                //check location for a piece
                currentPiece = board.getPiece(x, y);

                if((currentPiece != null) && (currentPiece.getColor() != playerTurn))
                {//if piece exists and is an enemy
                    if(isValidDestination(x, y, kingX, kingY, board))
                    {//enemy can hit king
                        threatLoc[0] = x;
                        threatLoc[1] = y;
                        threatFound = true;
                        break;
                    }//if
                }//if
            }//for
            if(threatFound)//if x loop was broken
                break;//break y loop too
        }//for
    }//end findThreat


    //<editor-fold defaultstate="collapsed" desc="ButtonDeclarations">  
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private static javax.swing.JButton FiveFive;
    private static javax.swing.JButton FiveFour;
    private static javax.swing.JButton FiveOne;
    private static javax.swing.JButton FiveSeven;
    private static javax.swing.JButton FiveSix;
    private static javax.swing.JButton FiveThree;
    private static javax.swing.JButton FiveTwo;
    private static javax.swing.JButton FiveZero;
    private static javax.swing.JButton FourFive;
    private static javax.swing.JButton FourFour;
    private static javax.swing.JButton FourOne;
    private static javax.swing.JButton FourSeven;
    private static javax.swing.JButton FourSix;
    private static javax.swing.JButton FourThree;
    private static javax.swing.JButton FourTwo;
    private static javax.swing.JButton FourZero;
    private static javax.swing.JButton OneFive;
    private static javax.swing.JButton OneFour;
    private static javax.swing.JButton OneOne;
    private static javax.swing.JButton OneSeven;
    private static javax.swing.JButton OneSix;
    private static javax.swing.JButton OneThree;
    private static javax.swing.JButton OneTwo;
    private static javax.swing.JButton OneZero;
    private static javax.swing.JButton SevenFive;
    private static javax.swing.JButton SevenFour;
    private static javax.swing.JButton SevenOne;
    private static javax.swing.JButton SevenSeven;
    private static javax.swing.JButton SevenSix;
    private static javax.swing.JButton SevenThree;
    private static javax.swing.JButton SevenTwo;
    private static javax.swing.JButton SevenZero;
    private static javax.swing.JButton SixFive;
    private static javax.swing.JButton SixFour;
    private static javax.swing.JButton SixOne;
    private static javax.swing.JButton SixSeven;
    private static javax.swing.JButton SixSix;
    private static javax.swing.JButton SixThree;
    private static javax.swing.JButton SixTwo;
    private static javax.swing.JButton SixZero;
    private static javax.swing.JButton ThreeFive;
    private static javax.swing.JButton ThreeFour;
    private static javax.swing.JButton ThreeOne;
    private static javax.swing.JButton ThreeSeven;
    private static javax.swing.JButton ThreeSix;
    private static javax.swing.JButton ThreeThree;
    private static javax.swing.JButton ThreeTwo;
    private static javax.swing.JButton ThreeZero;
    private static javax.swing.JButton TwoFive;
    private static javax.swing.JButton TwoFour;
    private static javax.swing.JButton TwoOne;
    private static javax.swing.JButton TwoSeven;
    private static javax.swing.JButton TwoSix;
    private static javax.swing.JButton TwoThree;
    private static javax.swing.JButton TwoTwo;
    private static javax.swing.JButton TwoZero;
    private static javax.swing.JButton ZeroFive;
    private static javax.swing.JButton ZeroFour;
    private static javax.swing.JButton ZeroOne;
    private static javax.swing.JButton ZeroSeven;
    private static javax.swing.JButton ZeroSix;
    private static javax.swing.JButton ZeroThree;
    private static javax.swing.JButton ZeroTwo;
    private static javax.swing.JButton ZeroZero;
    private static javax.swing.JButton helpButton;
    private static javax.swing.JButton iForfeit;
    private static javax.swing.JPanel jPanel1;
    private static javax.swing.JScrollPane jScrollPane1;
    private static javax.swing.JButton moveButton;
    private static javax.swing.JTextArea outputMessageBoard;
    private static javax.swing.JButton scoreButton;
    private static javax.swing.JButton undoButton;
    // End of variables declaration//GEN-END:variables
}
// </editor-fold>
